Hello All,
I am trying to use SELECT CASE to run a simple bit of VBA to change the zoom level of the worksheets in my workbook.
Here is the VBA ...
But when I attempt to run the macro, I get this error message ...
Appreciate any help.
Regards,
Steve
I am trying to use SELECT CASE to run a simple bit of VBA to change the zoom level of the worksheets in my workbook.
Here is the VBA ...
VBA Code:
Private Sub ComboBox2_Change()
Dim wrksht As Worksheet
Select Case Sheet5.Range("mag_setting").Value
Case Is = "95%"
For Each wrksht In ThisWorkbook.Worksheets
wrksht.Activate
ActiveWindow.Zoom = 95 ' Set zoom level to 95% for each worksheet
Case Is = "100%"
For Each wrksht In ThisWorkbook.Worksheets
wrksht.Activate
ActiveWindow.Zoom = 100 ' Set zoom level to 100% for each worksheet
Case Is = "110%"
For Each wrksht In ThisWorkbook.Worksheets
wrksht.Activate
ActiveWindow.Zoom = 110 ' Set zoom level to 110% for each worksheet
Case Is = "125%"
For Each wrksht In ThisWorkbook.Worksheets
wrksht.Activate
ActiveWindow.Zoom = 125 ' Set zoom level to 125% for each worksheet
Case Is = "150%"
For Each wrksht In ThisWorkbook.Worksheets
wrksht.Activate
ActiveWindow.Zoom = 150 ' Set zoom level to 150% for each worksheet
End Select
Sheet16.Activate 'activate the home sheet
Application.ScreenUpdating = True
End Sub
But when I attempt to run the macro, I get this error message ...
Appreciate any help.
Regards,
Steve