+ Reply to Thread
Results 1 to 5 of 5

VBA code to hide/unhide columns

  1. #1
    Registered User
    Join Date
    06-08-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    1

    VBA code to hide/unhide columns

    Hello! I am new here and have a vba question. I need columns W & X to be hidden based on whether or not an entry has been made in column U. So, Column U has a drop down menu for the user(s) to select from, however I would like Columns W and X to be hidden until they make a selection from one of the items in the list in U. Seems like this should be fairly simple however i have virtually no knowledge of vba.

    If anyone can help or recommend a book I would greatly appreciate it. Let me know if you need me to send the form.

    Thanks!

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: VBA code to hide/unhide columns

    Hello,

    I think code in attached workbook solve your problem.
    fill some data in column U and then delete them for see results.

    For check surce code press ALT+F11 and see into Sheet1 code.

    Best Regards
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: VBA code to hide/unhide columns

    radline2006,

    Welcome to the forum.
    It would help if you attached a copy of your workbook.
    Last edited by Charles; 06-08-2011 at 04:33 PM. Reason: Disregard my post
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: VBA code to hide/unhide columns

    Hi,

    Here is another way,Maybe?

    Please Login or Register  to view this content.
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  5. #5
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: VBA code to hide/unhide columns

    Hi,

    Here's a different version. When the user select "b" in the dropdown in range "A1" columns W and X will hide.
    Attached Files Attached Files
    Last edited by Charles; 06-08-2011 at 05:44 PM. Reason: repost new version

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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