+ Reply to Thread
Results 1 to 5 of 5

Hiding empty columns in range

  1. #1
    Registered User
    Join Date
    06-18-2014
    Location
    Netherlands
    MS-Off Ver
    2014
    Posts
    23

    Hiding empty columns in range

    I am trying to hide columns in a range, "P8:ET1087" but it isn't working. After I autofilter a value, every row will be hidden except for the rows where the value is found. This is always 6 rows, won't be more or less.

    The 6 cells in every column are the same and contain from 1 to 6:
    Text
    Text
    Date
    Number
    Text
    Date

    What I am trying to do is to hide the column if all cells in that column are blank/empty after it's autofiltered. That for the 135 columns, from P to ET.

    I was messing around with the following code:

    Please Login or Register  to view this content.
    But it doesn't seem to work, what am i doing wrong? Can somebody help me?

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Hiding empty columns in range

    I think i have a good idea, but would need an example worksheet to play with.

    Please post a toy example.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Hiding empty columns in range

    Got what you need..
    Try this code...
    Please Login or Register  to view this content.
    waiting for *

  4. #4
    Registered User
    Join Date
    06-18-2014
    Location
    Netherlands
    MS-Off Ver
    2014
    Posts
    23

    Re: Hiding empty columns in range

    Doesn't seem to work and takes about 1 min till it's done, but nothing happens...

  5. #5
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Hiding empty columns in range

    Hi jhonneyboy, try this:

    Please Login or Register  to view this content.
    Subtotal(3,ref) can be used as the counta function for a filtered range.

    Hope this works for you.

    Cheers,
    berlan

+ 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. Select a range of columns including the last non-empty column
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2013, 05:32 PM
  2. Filtering a selected row, then hiding all columns that are empty
    By dhpham in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2013, 12:44 PM
  3. Macro: select entire range with empty columns in between
    By nachousa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2010, 09:54 AM
  4. hiding range of columns depending on a set value
    By toeragh in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-12-2007, 12:54 PM
  5. [SOLVED] Finding next empty empty cell in a range of columns
    By UncleBun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2006, 07:25 PM

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