BusinessMonkey
New Member
- Joined
- Jun 4, 2014
- Messages
- 5
I have been using this piece of code within the same workbook, on other sheets and it works just fine. It simply selects a range of cells and uses the "Zoom to Selection" function aka "ActiveWindow.zoom = true" to fit the sheet properly on the screen. I use this because the workbook is opened on different computers with different sized monitors. When I use this piece of code on one particular sheet, I get this error: "Method 'Range' of object _'Global' failed".
here is my code:
I am new to VBA. I am pretty sure this has something to do with the fact that "Range" doesn't know what cells I'm referring to. but I have also tried replacing the code with whats below and I get the same error...
(the underlined code is what gives the error)
Thanks
here is my code:
Code:
'FIX VIEW
Application.DisplayAlerts = False
Application.ScreenUpdating = False
[U] Range("A1:023").Activate[/U]
ActiveWindow.Zoom = True
Cells(5, 7).Select
I am new to VBA. I am pretty sure this has something to do with the fact that "Range" doesn't know what cells I'm referring to. but I have also tried replacing the code with whats below and I get the same error...
Code:
'FIX VIEW
Application.DisplayAlerts = False
Application.ScreenUpdating = False
[U] Workbook("DCSLOG").Sheets("APercentData").Range("A1:023").Activate[/U]
ActiveWindow.Zoom = True
Cells(5, 7).Select
(the underlined code is what gives the error)
Thanks