+ Reply to Thread
Results 1 to 3 of 3

How do I select a range of columns using Union?

  1. #1
    Forum Contributor
    Join Date
    10-06-2015
    Location
    Leeds, England
    MS-Off Ver
    365 Version 2302 Build 16.0.16130.20942
    Posts
    130

    How do I select a range of columns using Union?

    I have some code linked to a button when pressed to show and hide a range of columns. The Column range can change depending who needs to use what amount of columns.

    To dictate the range, I have named the cell before the range "ColStart" and the cell after the range "ColEnd".

    The code I have is shown below to hide and show the columns within the range, but it seems to only show the two named cells columns, how do I make it use the range in between the named cells?

    Please Login or Register  to view this content.
    I hope I've explained this well enough.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: How do I select a range of columns using Union?

    Hi,

    You need only use Range rather than Union
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    10-06-2015
    Location
    Leeds, England
    MS-Off Ver
    365 Version 2302 Build 16.0.16130.20942
    Posts
    130

    Re: How do I select a range of columns using Union?

    Quote Originally Posted by xlnitwit View Post
    Hi,

    You need only use Range rather than Union
    Please Login or Register  to view this content.
    Thankyou! Works perfectly now

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How To Use UNION and Ranges To Speed Up Deleting Many Columns?
    By eryksd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2016, 08:51 PM
  2. [SOLVED] Macro to select non-contiguous union of cells based on values in other column
    By gutkinma in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-14-2014, 07:41 AM
  3. [SOLVED] Range/union
    By Dibbley247 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2013, 10:35 AM
  4. How to loop with union() / select multiple ranges at ones
    By furiousfox in forum Excel General
    Replies: 6
    Last Post: 06-02-2010, 08:02 AM
  5. Range.columns.count property returns wrong count after union operation
    By gopinan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2008, 04:48 AM
  6. Formula in Range Union!!
    By blueangel2005 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2008, 06:35 AM
  7. Union/Range/Cells
    By KentÄ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2005, 08:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1