+ Reply to Thread
Results 1 to 7 of 7

Hide Column If Cell Value is empty from Checkbox

  1. #1
    Registered User
    Join Date
    08-07-2013
    Location
    SWE
    MS-Off Ver
    Excel 2011
    Posts
    15

    Hide Column If Cell Value is empty from Checkbox

    Hi,

    I´m looking for a macro were i could filter columns based on its cell value in a specific row (5) with a checkbox placed in row 5. So for example if a column in this specific row 5 is empty then it should be hidden when the checkbox is ticked. The sheet containt multiple rows with the same function, which makes it a little complex. If the same column, in row 6 contains a value, then the coloumn should not be hidden even though checkboxes from row 5 and row 6 is ticked.

    There is also 2 specific columns that should be independent and should not be hidden in any case.

    I have tried many codes with the best i could was to hide all columns even though they contained a value....


    Pleases se attachment.

    Best regards, Guple
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide Column If Cell Value is empty from Checkbox

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    08-07-2013
    Location
    SWE
    MS-Off Ver
    Excel 2011
    Posts
    15

    Re: Hide Column If Cell Value is empty from Checkbox

    Thanks, this worked like a charm!! :D

    Though i still wont get to work as good as it need... I need the macro to prioritize the rows with the checkboxes så they never hide a cell that contain X.

    The concept is to choose wish rows i want to focus on with the checkboxes, and then let the macro hide the choosen rows columns that is is empty and only show the columns with X. But if i choose 2 rows etc. and one of the rows contains more x and then the other, no columns that contain x should be hidden.

    I explained in the excel file with color! Should be easy to understand.


    Book4.xlsx

  4. #4
    Registered User
    Join Date
    08-07-2013
    Location
    SWE
    MS-Off Ver
    Excel 2011
    Posts
    15

    Re: Hide Column If Cell Value is empty from Checkbox

    What does this mean?

    Thank you!!

    " For c = 5 To 13
    If Cells(5, c) = "" And c <> 7 And c <> 10 Then Columns(c).Hidden = True "

  5. #5
    Registered User
    Join Date
    08-07-2013
    Location
    SWE
    MS-Off Ver
    Excel 2011
    Posts
    15

    Re: Hide Column If Cell Value is empty from Checkbox

    ¨BUMP! Would really appreciate some help here...

    Best regrads, Guple

  6. #6
    Registered User
    Join Date
    08-07-2013
    Location
    SWE
    MS-Off Ver
    Excel 2011
    Posts
    15

    Re: Hide Column If Cell Value is empty from Checkbox

    BUMP! Would really appreciate some help here...

    Best regrads, Guple

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Hide Column If Cell Value is empty from Checkbox

    Quote Originally Posted by Guple View Post
    What does this mean?
    " For c = 5 To 13
    If Cells(5, c) = "" And c <> 7 And c <> 10 Then Columns(c).Hidden = True "
    For column = 5 to 13
    if Cells(5, column) is empty And column is not G And column is not J Then hide column

+ 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. Hide rows if cell in Column E is empty
    By annemsauro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2013, 02:27 PM
  2. VBA help if the checkbox is selected hide/unhide column
    By bgreen66 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2013, 03:39 PM
  3. [SOLVED] Tick checkbox if a certain cell is not empty.
    By jazzy747 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-12-2012, 05:43 PM
  4. Macro Required - Hide columns where cell in a single column is empty
    By heatwave in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2012, 12:53 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