Here's what i'd like the macro to do:
Run a macro on every sheet except sheet1 and sheet2
dim rs as worksheet
for each rs in sheets if rs.name = "Sheet1" or "Sheet2" then next rs else rs.name =rs.range("
I've new to VBA and i keep getting a 'next without for' error. not sure how to next the for loop and the if statement. thanks in advance
Dim rs As Worksheet
For Each rs In Sheets
If rs.Name = "sheet1" Or "sheet2" Then
Next ws
Else: rs.Name = rs.Range("N2") 'rename sheet base on vendor name field
End If
Next rs
Small mixup, try :