Results 1 to 16 of 16

Hide specified columns via macro

Threaded View

  1. #1
    Registered User
    Join Date
    05-16-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    78

    Hide specified columns via macro

    Hi,

    i want to hide specified columns in a WB.

    The macro should ask which columns i want to hide.
    These columns could be A,C,H or D, AA, AH.
    So i need a request from the macro with column i want to hide.
    This request should ask me as long i enter a name for a column.
    If i do not enter any more, the macro should hide the selected columns.

    Normaly the number of columns i have to hide is between 1 and 16.
          
    ' Select Row(s) for hide
    
    
    Private Sub InputTest()
    
    Dim InputDummy As String, Cancel As Boolean, strPrompt As String
    
    strPrompt = "Please declare column to hide"
    Do
        InputDummy = InputBox(strPrompt, "No column selected")
        Cancel = StrPtr(InputDummy) = 0
        strPrompt = "Please choose a column to hide an press OK"
    Loop Until InputDummy <> "" Or Cancel
    
    If Not Cancel Then
        
        Columns(InputDummy).Select
        Selection.EntireColumn.Hidden = True
    
    Else
        MsgBox "You press 'Cancel'"
    End If
           
           
    
    End Sub
    but how is it possible to choose more than 1 column?

    Thank you

    kind regards
    Last edited by bluesurger; 05-19-2014 at 09:46 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro; Hide Columns; VBA
    By overbomb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 09:36 AM
  2. Macro to Hide Columns Where Sum is Zero
    By mgordon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2013, 10:17 PM
  3. Macro to Hide Columns
    By Shazz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-24-2013, 10:32 AM
  4. [SOLVED] hide columns macro
    By xkarenxxxx in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2006, 12:35 PM
  5. [SOLVED] macro to hide columns
    By Shooter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-27-2005, 05:05 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