I have two worksheets one with data and on with a form I would like to find
the row that is selected on the data sheet and use it on the form sheet.
myRow = ActiveWorkbook.Worksheets("Data").ActiveCell.Row
I cannot find a way for this to happen. I have this in a module procedure
which I call when the form sheet is activated.
any help would be greatly appreciated
Anthony
Dave Peterson - 28 Jan 2008 19:56 GMT
The Activecell belongs to a window or the application--not the worksheet.
So one way is to go to that worksheet and look at the activewindow:
Dim myRow As Long
Dim ActCell As Range
Dim CurSel As Range
Application.ScreenUpdating = False
Set CurSel = Selection
Set ActCell = ActiveCell
Worksheets("sheet2").Select
myRow = ActiveWindow.ActiveCell.Row
MsgBox myRow
Application.Goto CurSel
ActCell.Select
Application.ScreenUpdating = True
> I have two worksheets one with data and on with a form I would like to find
> the row that is selected on the data sheet and use it on the form sheet.
[quoted text clipped - 7 lines]
>
> Anthony

Signature
Dave Peterson