G
Guest
Hi,
I am trying to call up formatting procedures to format sheets, but I don't
want to apply the formatting procedures to any sheet with one of the five
names as indicated in the sample code below. Why am I getting an error
message telling me "Next without For"? Is there a more efficient way to
execute this code?
Here is the sample code:
Set wb = ActiveWorkbook
Set sh = ActiveSheet
For Each ws In wb
If ws.Name = "SUMMARY" Then
If ws.Name = "Parameters" Then
If ws.Name = "PIVOTDATA" Then
If ws.Name = "PIV_Deliverables" Then
If ws.Name = "PIV_RC" Then
GoTo Here:
Call Formatting
Next ws
Here:
Application.Goto "Summary_Home"
Thanks in advance!
I am trying to call up formatting procedures to format sheets, but I don't
want to apply the formatting procedures to any sheet with one of the five
names as indicated in the sample code below. Why am I getting an error
message telling me "Next without For"? Is there a more efficient way to
execute this code?
Here is the sample code:
Set wb = ActiveWorkbook
Set sh = ActiveSheet
For Each ws In wb
If ws.Name = "SUMMARY" Then
If ws.Name = "Parameters" Then
If ws.Name = "PIVOTDATA" Then
If ws.Name = "PIV_Deliverables" Then
If ws.Name = "PIV_RC" Then
GoTo Here:
Call Formatting
Next ws
Here:
Application.Goto "Summary_Home"
Thanks in advance!