Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
So I've recorded a number of macros that each hide a different Week.
Sub Macro1() ' Macro1 Macro Application.Goto Reference:="Week1" Selection.EntireColumn.Hidden = True End Sub .. .. .. Sub Macro10() ' Macro10 Macro Application.Goto Reference:="Week10" Selection.EntireColumn.Hidden = True End Sub How do I create one macro to do all of this by using a variable for the "Week number" that is provided by asking the user to select the Week number from an input box or a drop down list? Thanks |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub hidecolumn()
'Columns.Hidden = False'uncomment to unhide all first cth = InputBox("Enter week number ie: 1 10") mycol = "week" & cth Range(mycol).EntireColumn.Hidden = True End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Ephraim" wrote in message ... So I've recorded a number of macros that each hide a different Week. Sub Macro1() ' Macro1 Macro Application.Goto Reference:="Week1" Selection.EntireColumn.Hidden = True End Sub . . . Sub Macro10() ' Macro10 Macro Application.Goto Reference:="Week10" Selection.EntireColumn.Hidden = True End Sub How do I create one macro to do all of this by using a variable for the "Week number" that is provided by asking the user to select the Week number from an input box or a drop down list? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combine two macros | Excel Discussion (Misc queries) | |||
How do I combine MACROS and functions? | New Users to Excel | |||
Macros with variable data | Excel Worksheet Functions | |||
combine two macros | Excel Worksheet Functions | |||
How to combine two data sets with one category of variable in com. | New Users to Excel |