+ Reply to Thread
Results 1 to 4 of 4

Hide Columns Based on Answer in an InputBox

  1. #1
    Registered User
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    91

    Hide Columns Based on Answer in an InputBox

    Hi,

    Is it possible to write a code that asks a user to input a column and it will hide the columns from that column to a fixed column?

    For instance, if the fixed column is always 'AB' and in the InputBox the user put 'Z' in the field, it'll hide columns Z through AB.

    And as a bonus : I want to prevent people from hiding columns that have data in it, is it possible for the box to return an error if the =sum(Z3:AB10)<>0?

    Thanks so much!

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,680

    Re: Hide Columns Based on Answer in an InputBox

    Hi
    try this macro
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Hide Columns Based on Answer in an InputBox

    Quote Originally Posted by NickyC View Post
    Hi
    try this macro
    Please Login or Register  to view this content.
    Thanks --

    Z was just an example and wouldn't be in the actual code, in the example, Z = whatever the user responded with
    But I think i can play around w/ your code a bit and arrive at what I'm looking for
    Thanks again

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,680

    Re: Hide Columns Based on Answer in an InputBox

    Hi
    I included Z because you mentioned it, but you should be able to input any column letter in the inputbox and the macro should work hiding the range between that column and AB

+ 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/Hide Columns Based on Value in Cell
    By brickwall823 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2015, 02:42 PM
  2. Use Inputbox answer to be used in another sub procedure
    By kevinmelendres in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-15-2015, 09:22 PM
  3. [SOLVED] Answer for inputbox
    By juriemagic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2014, 03:11 AM
  4. [SOLVED] Deleting columns based on date from InputBox
    By ph03n1x in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-30-2014, 11:50 AM
  5. Macro that will hide/unhide rows based on message box answer
    By Aplampert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2014, 05:50 PM
  6. Replies: 2
    Last Post: 06-21-2013, 10:04 AM
  7. [SOLVED] Automatically answer InputBox
    By rnd37 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-17-2012, 09:34 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