.Select, .Activesheet, .Activecell etc…

前端 未结 5 448
傲寒
傲寒 2021-01-13 04:40

For this question, I refer to the post below to clarify myself:
Why is my conditional format offset when added by VBA?

In many, many posts I see these days, OP\'

5条回答
  •  抹茶落季
    2021-01-13 05:08

    There are a few methods in Excel that require Activate or ActiveSheet/ActiveWorkbook etc as I've been caught with a gotchas on occasion. The only one I can remember at the moment is the zoom property. Zoom affects only the sheet that's currently active in the window so to zoom all sheets you would need something like

    Sub SetZoom()
    Dim ws As Worksheet
        Application.screenupdating = false
    
        For Each ws In Worksheets
            ws.Select
            ActiveWindow.Zoom = 80
        Next ws
    
        Application.screenupdating = true
    End Sub
    

提交回复
热议问题