Selective call procedure

  • Thread starter Thread starter jamesa
  • Start date Start date
J

jamesa

Sub WSheetOctW3()
'
' WSheetMaster Macro
' Macro recorded 01/10/2003 by sbtp00220
'
Call FormatMainWSheet
Call ColorPMMD01
Call ColorPMMD02
Call ColorPMMD03
End Sub

I want to apply the above macros to different workshhets.
On some of them not all the modules apply.
How can I avoid the debug error message where a call does
not apply on a worksheet.
 
Try this:
Sub WSheetOctW3()
'
' WSheetMaster Macro
' Macro recorded 01/10/2003 by sbtp00220
' On Error Resume Next
Call FormatMainWSheet
Call ColorPMMD01
Call ColorPMMD02
Call ColorPMMD03 On Error GoTo 0
End Sub

The first error handling statement results error-producing
lines being skipped, the second one resets error handling
to default.

Nikos Y.
 
Hi,

Not sure if this is what you need:

Sub WSheetOctW3()
'
' WSheetMaster Macro
' Macro recorded 01/10/2003 by sbtp00220
'
If Activesheet.Name="Joe" then
Call FormatMainWSheet
End If
If Activesheet.Name="Joe" Or Activesheet.Name="John"
then
Call ColorPMMD01
End If
Call ColorPMMD02
Call ColorPMMD03
End Sub


Regards,

Jan Karel Pieterse
Excel TA/MVP
 
Back
Top