How to run a macro on some but not all sheets in a workbook?

前端 未结 2 1136
后悔当初
后悔当初 2021-01-28 14:40

I have a workbook that contains worksheets for each industry group in the S&P 500 and wrote the macro below to update all the stock information on them when I press a comman

2条回答
  •  悲哀的现实
    2021-01-28 15:27

    Change

     If Not Sht.Name = "Cover" _
        And Not Sht.Name = "Select Industry" Then
    

    To

    If Sht.Name <> "Cover" And Sht.Name <> "Select Industry" Then 
    

    Don't forget your End If before Next Sht

提交回复
热议问题