Thread: skip worksheet
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter_A_M (NL) Peter_A_M (NL) is offline
external usenet poster
 
Posts: 12
Default skip worksheet

Herewith I just react to the error-message you received.
Your code isn't grammatically correct, as I indicated below.

For Each wkSht In ActiveWorkbook.Worksheets
If wkSht.Name = "County Records" Then GoTo restOfCodeSkipped
'Next wkSht 'leave this line out!

(... rest of code ...)

restOfCodeSkipped: 'destination for GoTo added
Next wkSht


So I made 2 modifications:
1. I added GoTo restOfCodeSkipped and destination in order to skip code in
between;
2. The condition in your If-statement wasn't correct;
' wkSht.Name = "County Records" ' evaluates either to True or to False;
so don't add an ' extra = True '

Many greetings,
Peter