Return To Home

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

I know this should be simple but I haven't figured it out
yet. I have multiple worksheets with title rows. Some
are 2, 3, 4, and 5 rows deep. Below the last row the pane
is frozen so users can enter data and always see the
column headings.

VBA extracts this data into a temp worksheet, then returns
the user to the sheet they initiated the action from.

How do I code it so the cursor comes back to the "Home"
cell? With the panes frozen, this could be cells A3, A4,
A5, or A6 depending on the number of title rows. Is there
a routine in VBA that is similar to hitting the "Home" key
on a keyboard?

Thanks for any help.

Lee
 
try these

Sub gothere()
x = Sheets("yoursheet").Cells(Rows.Count, "a").End(xlUp).Row + 1
Application.Goto Sheets("yoursheet").Cells(x - 10, 1), Scroll:=True
End Sub

Sub CtrlHome()
SendKeys "^{home}"
End Sub
 
rw = ActiveWindow.SplitRow + 1
col = ActiveWindow.SplitColumn + 1
cells(rw,col).Select
 

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

Back
Top