+ Reply to Thread
Results 1 to 3 of 3

VBA Hide Non-Contiguous Columns

  1. #1
    Registered User
    Join Date
    07-09-2019
    Location
    United State
    MS-Off Ver
    2019
    Posts
    53

    VBA Hide Non-Contiguous Columns

    I am new to VBA, so far I have been mainly recording macros and reading information on the web to develop macros.

    I need to Hide non-contiguous columns using a macro. However when I do so, the last selection of columns to hide does not work properly. I need to Hide Rows A through C, I, L, and N and O with columns D,E, F, G, H, J, K M and P in view (not hidden).

    The first command in the macro is to UNhide all columns where there is data, that is Columns A through V. After that the code proceeds to hide the aforementioned columns. But on the last set of columns to hide , the macro seems to still have selected Columns A through V and the final result of the macro that Columns A through I, L, N, O are hidden.

    Can someone help? Like I said I suspect that the problem is that the macro starts out with selecting Columns A-V, but even when I don't do that, the correct columns do not get hidden.

    I've attached the spreadsheet with macros. The suspect macro is names "OrderPull" (Click on Order Pull View button).

    THANK YOU.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA Hide Non-Contiguous Columns

    Try changing your code to:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-09-2019
    Location
    United State
    MS-Off Ver
    2019
    Posts
    53

    Re: VBA Hide Non-Contiguous Columns

    Maniacb,

    YES, THAT WORKED!!!! I really need to learn a lot, and you helped!!!

    Hurray!

+ 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. sumif with non-contiguous columns
    By sumdumgai in forum Excel General
    Replies: 4
    Last Post: 10-08-2018, 08:54 PM
  2. Copy contiguous columns and paste as non-contiguous
    By absconditus in forum Excel General
    Replies: 1
    Last Post: 12-29-2014, 03:17 AM
  3. [SOLVED] How to sum non-contiguous columns applied as a formula on contiguous cells
    By figo12 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2013, 01:07 PM
  4. Replies: 0
    Last Post: 08-03-2012, 04:31 PM
  5. Hide/Unhide Non-contiguous rows based on Data Validation Selection
    By ahkarchem in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2012, 11:52 AM
  6. [SOLVED] Copying non-contiguous columns to contiguous columns
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2006, 10:54 PM
  7. [SOLVED] Hide non-contiguous columns
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 08:30 AM

Tags for this Thread

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