Scroll to top of calc sheet / Basic
Posted: Thu Apr 01, 2010 8:42 pm
How do I tell Calc to scroll to the top of a worksheet in Basic without activating the sheet?
Background: I have a spreadsheet with several worksheets. I have written a macro to sort the data in all of the worksheets each time the spreadsheet is opened. After the data are sorted, I want to make sure that the individual worksheets are scrolled up to the top, so that the most important data (which are at the top) are immediately visible when a user clicks on a worksheet. I have been doing this as follows:
where the column heads are in row 1, and row 2 is the first data row. But when I do this, Calc visible flashes through all the worksheets as it processes them, which is annoying. So is there a way of doing the same thing for hidden worksheets without making them visible?
I am using OO 3.0.0 on Ubuntu 8.10. Any suggestions would be very welcome.
Many thanks,
graneezle
Background: I have a spreadsheet with several worksheets. I have written a macro to sort the data in all of the worksheets each time the spreadsheet is opened. After the data are sorted, I want to make sure that the individual worksheets are scrolled up to the top, so that the most important data (which are at the top) are immediately visible when a user clicks on a worksheet. I have been doing this as follows:
Code: Select all
oRange = oSheet.getCellRangeByName("A2")
ThisComponent.getCurrentController.select(oRange)
I am using OO 3.0.0 on Ubuntu 8.10. Any suggestions would be very welcome.
Many thanks,
graneezle