hi
I would like a inputbox, allow me to choose a hidden column and display it.
example:
I have a spreadsheet and Column "A", "D" and "G", they are hidden.
Pressing a button will open a inputbox macro, I type it I want to display column.
Thank![]()
hi
I would like a inputbox, allow me to choose a hidden column and display it.
example:
I have a spreadsheet and Column "A", "D" and "G", they are hidden.
Pressing a button will open a inputbox macro, I type it I want to display column.
Thank![]()
Last edited by marreco; 02-11-2012 at 07:51 PM.
![]()
Option Explicit Sub ShowCols() Dim Col As Variant, _ Check As Variant, _ ListOfColumns As String, _ Choice As String, _ Comma As String 'find all the hidden columns in the sheet and build a list For Each Col In ActiveSheet.Columns If Col.Hidden = True Then ListOfColumns = ListOfColumns & Comma & Left(Col.Address(0, 0), 1) Comma = "," End If Next Col 'No hidden columns found in sheet; tell him and exit the macro If ListOfColumns = "" Then MsgBox "No hidden columns" Exit Sub End If 'present the user with a list of hidden columns to choose from Choice = InputBox("enter one of the columns listed below" & vbCrLf & ListOfColumns) 'check if the user choice is in the list, if not tell him and exit the macro Check = InStr(ListOfColumns, UCase(Choice)) If Check = 0 Then MsgBox Choice & " was not in the list" Exit Sub End If 'unhide the column selected Columns(Choice).EntireColumn.Hidden = False End Sub
Last edited by protonLeah; 02-11-2012 at 07:35 PM.
Ben Van Johnson
Thank you for responding!
Thank you for responding!
Boy you are a master of Excel, a genius!
was very good!
My answer was not counted as two.
Thank you protonLeah
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks