Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Problem
I have 35 macros named "Week 1" etc. to "Week 35". Is it possible t
build a macro that will run each macro according to a cell value? i.e if cell value = 1 it would run "Week 1", if cell value = 23 it woul run "Week 23". Can anyone help me? abbevill -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Problem
Sub SelectMacro()
Dim x As Integer x = ActiveCell.Value On Error Resume Next Application.Run ("Week" & x) On Error GoTo 0 End Sub Regards, Greg -----Original Message----- I have 35 macros named "Week 1" etc. to "Week 35". Is it possible to build a macro that will run each macro according to a cell value? i.e. if cell value = 1 it would run "Week 1", if cell value = 23 it would run "Week 23". Can anyone help me? abbeville --- Message posted from http://www.ExcelForum.com/ . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Problem
This picks the value from cell B1
Sub Test() Dim strMacroName strMacroName = "Week" & CStr(ActiveSheet.Cells(1, 2).Value) Application.Run (strMacroName) End Sub "abbeville " wrote in message ... I have 35 macros named "Week 1" etc. to "Week 35". Is it possible to build a macro that will run each macro according to a cell value? i.e. if cell value = 1 it would run "Week 1", if cell value = 23 it would run "Week 23". Can anyone help me? abbeville --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Problem
Thank You for your help. I tried Greg Wilson's first & it did exactl
what I wanted. abbevill -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Problem viewing Excel 2003 Pivot Chart fields in Excel 2007 | Charts and Charting in Excel | |||
Weird problem with Excel 2000...Worksheets disappearing in a shared Excel file | Excel Discussion (Misc queries) | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
Excel 97 chart opened in Excel 2003 - Source Data problem | Charts and Charting in Excel |