excel vbe scroll range - how to save?

B

Bob

Tools -> Macro -> VBE
VBE, Properties Window, Scroll Area
Ok, I set Scroll Area A1:B164, save and return to Excel spreadsheet.
Data entry works fine, cursor jumps from A1 -> B1, and down to line 2, A2 ->
B2, etc
Save spreadsheet, and exit.
When loading same spreadsheet, the ScrollArea is blank.
How do I save this feature?
 
J

Jim Thomlinson

Sorry Bob I thought that the scroll area saved with the worksheet but it
needs to be set when the book is opened... To the thisworkbook module (double
click on it in project explorer) add

Private Sub Workbook_Open()
Sheet1.ScrollArea = "A1:B164" 'or whetever sheet you need
End Sub

Macros must be enabled for this to work or the project digitally signed...
 
B

Bob

That did it.
One minor addition. Suppose I want just one more cell active, to enter new
report date manually? Is it possible to have two ranges? c2 and a4:b164 or
even a1, a4:b164

If not thanks a lot, scroll and save a1.b164 work well enough
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top