Finding and Activating the first blank cell
Hi Mike,
1. ScrollArea.
There's no need to define the ScrollArea each time user selects a different
cell on the sheet, which is what occurs with your posted code. Once set it's
set, until programmatically changed or manually by changing the property in
the sheet module properties.
2. Not sure what you mean by 'the first blank one' [cell], eg the last cell
with data in Col-A, Row-1, the cell in a row below the last row that
contains data in any column, ditto any of the preceding to include last cell
containing any kind of formatting even if empty. For the latter record a
macro while doing Ctrl-End.
to select the cell below the last cell that contains data in col-A when the
sheet is activated, try this in the sheet module (right-click sheet tab
view code).
Private Sub Worksheet_Activate()
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Activate
End Sub
Regards,
Peter T
wrote in message
ups.com...
Hi there,
I've never done any Visual Basic programming (only C) and have been
browsing this group for a while. I need to find a way to do two
things:
1. Set the scrollable area for a worksheet when it's reopened (I have
accomplished this by using
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet1.ScrollArea = "a1:g5000"
End Sub
I found this on another usenet post and edited it fit my application.
I'm not sure why it is being done every time the selection is changed
but it seems to be working which makes me happy.
2. Now the part I'm stuck on. I need to make it so that when the
user opens the worksheet the active cell will be the first blank one in
the scrollable area. I've seen several other posts, but yet to find a
definitive solution for someone on my... newbiness level.
Thanks for your help!
Mike
|