Dim WS As Worksheet
.....
.....
For Each WS In Worksheets
If WS.Name = "Sheet2" Then
'
' You found Sheet2, so execute your code here
'
Exit For
End If
Next
......
......
Note the Exit For statement after your Sheet2 code... that stops the loop
from continuing on (you already found Sheet2, so there is no longer any need
to keep looping looking for it).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.