Run A Macro on Each Sheet Except Sheet1 and Sheet2

后端 未结 1 1372
你的背包
你的背包 2021-01-25 04:45

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

相关标签:
1条回答
  • 2021-01-25 05:09

    Small mixup, try :

    Dim rs As Worksheet
    
    For Each rs In ThisWorkbook.Worksheets
       If rs.Name <> "Sheet1" And rs.Name <> "Sheet2" Then
            rs.Name = rs.Range("N2").Value 'rename sheet base on vendor name field
       End If
    Next rs
    
    End Sub
    
    0 讨论(0)
提交回复
热议问题