Home |
Search |
Today's Posts |
#3
![]() |
|||
|
|||
![]()
One way:
With something For iCtr = 1 to n If TopCell Is Nothing Then MsgBox myStr(iCtr) & " wasn't found" MySub Else .Range(TopCell, BotCell).Select End If Next iCtr End With '... End Sub Public Sub MySub() 'Do something here End Sub In article , "Jeff" wrote: Hi, This is a partial copy of my VBA macro. My question is: Is possible in VBA to execute a sub in an " If ... then statement?" If TopCell Is Nothing Then MsgBox myStr(iCtr) & " wasn't found" Exit Sub --- here can I request the execution of sub instead of Exit sub? Else .Range(TopCell, BotCell).Select End If Next iCtr End With Thanks, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLOOKUP question | Excel Discussion (Misc queries) | |||
basic pie chart question | Charts and Charting in Excel | |||
Barchart 'GroupBy' Question | Charts and Charting in Excel | |||
Jon Peltier - Pivot Table Result for yesterday's "Complex Chart" Question | Charts and Charting in Excel | |||
Paste Special Question | Excel Discussion (Misc queries) |