View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
Gman Gman is offline
external usenet poster
 
Posts: 18
Default How to set programmatically focus on specified Excel row?

I'm not quite sure what you're trying to do -- or more accurately why...

Whenever you select a row AFAIK it *always* selects the first cell in
the row. Thus, to achieve what you seem to be asking you would need to
revert to the originally selected cell. E.g.

Sub SelectRowOfActiveCellRetainingActiveCell()
Dim r As Range
Set r = ActiveCell
Rows(r.Row).Select
r.Activate
Set r = Nothing
End Sub

Now, if you subsequently want to drop down a row try this

Sub SelectNextRowOfActiveCellIfYouKnowWhatIMean()
Dim r As Range
Set r = ActiveCell.Offset(1, 0)
Rows(r.Row).Select
r.Activate
Set r = Nothing
End Sub

My recommendation: Explain why you're trying to do all this and maybe
someone will come up with a better approach.

HTH