ExpExchHelp
asked on
Excel VBA -- Set multiple scroll areas
In Excel, I'm using VBA (see below) to limit the scroll area upon opening a spreadsheet.
This solution works great except that I need several (non-adjacent) cell ranges. Unless not possible otherwise, I'd prefer to NOT use the "Lock cell/sheet" feature.
I attempted to tweak the code (see below); however, it throws an error message. How can I use multiple cell ranges as part of the VBA below?
Private Sub Workbook_Open()
'Locks Scroll Area
Sheet1.ScrollArea = "C14:D20"
End Sub
This solution works great except that I need several (non-adjacent) cell ranges. Unless not possible otherwise, I'd prefer to NOT use the "Lock cell/sheet" feature.
I attempted to tweak the code (see below); however, it throws an error message. How can I use multiple cell ranges as part of the VBA below?
Private Sub Workbook_Open()
'Locks Scroll Area
Sheet1.ScrollArea = "C14:D20, D23, B28"
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.