Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This week is week # 45.
I have 52 macros on a worksheet. Each one selects data for a particular week when a button is pressed. I would like to eliminate the buttons and have the macro start when the particular week# is typed in the cell. If a particular week # is typed in a cell how do I get the macro to start for the week number selected. The week number may range from 1 to 52. Many thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Application.Run "macro_" & Range("A1").Value
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "zephyr" wrote in message ... This week is week # 45. I have 52 macros on a worksheet. Each one selects data for a particular week when a button is pressed. I would like to eliminate the buttons and have the macro start when the particular week# is typed in the cell. If a particular week # is typed in a cell how do I get the macro to start for the week number selected. The week number may range from 1 to 52. Many thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Are you sure that you really need 52 macros instead of having one using the
Week No as parameter? In the latter case this event sub does the job (say cell for inputting week No is A1) Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address(False, False) = "A1" Then Call weekmacro(Target.Value) End If End Sub Regards, Stefi Sub weekmacro(weekno) MsgBox "macro" & weekno End Sub zephyr ezt *rta: This week is week # 45. I have 52 macros on a worksheet. Each one selects data for a particular week when a button is pressed. I would like to eliminate the buttons and have the macro start when the particular week# is typed in the cell. If a particular week # is typed in a cell how do I get the macro to start for the week number selected. The week number may range from 1 to 52. Many thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro question | Excel Worksheet Functions | |||
Macro - Return to starting cell | Excel Worksheet Functions | |||
Macro for cell selection starting with Last Cell | Excel Worksheet Functions | |||
Editing a simple macro | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) |