Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
excel 2000
I need to automatically start one of four macros that prints different items based on the results in a specific cell. basically if C7 = 2 run macro1 if C7 = 3 run macro2 if C7 = 4 run macro3 if C7 = 5 run macro4 Any help would be greatly appreciated. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("C7")) Is Nothing Then With Target If .Value = 2 Then Macro1 ElseIf .Value = 3 Then Macro2 ElseIf .Value = 4 Then Macro3 ElseIf .Value = 5 Then Macro4 End If End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Truseeker" wrote in message ... excel 2000 I need to automatically start one of four macros that prints different items based on the results in a specific cell. basically if C7 = 2 run macro1 if C7 = 3 run macro2 if C7 = 4 run macro3 if C7 = 5 run macro4 Any help would be greatly appreciated. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formating based on start and end dates | Excel Discussion (Misc queries) | |||
start a macro or procedure based on user putting an x in a cell | Excel Discussion (Misc queries) | |||
Calculate Start Dates based on Need-By Date? | Excel Worksheet Functions | |||
vlookup based on random result returns incorrect result | Excel Worksheet Functions | |||
Can't start Excel based on File Type | Excel Discussion (Misc queries) |