R
Reno
Folks:
Been staring at this code for days, and am frankly lost. Not really an Excel
programmer but cobbled this together from samples and research. All I wish
to do is to take a value from one sheet and position to that same value in
another sheet, and then set the row in the sheet to current row. Here is the
code....
Sub current_Cell()
MsgBox ActiveCell.Value
For Each RosRng In Sheets("sheet2").UsedRange.Rows
If RosRng.Range("D1").Value = ActiveCell.Value Then
MsgBox "gotit"
End If
Next
End Sub
I have 4 rows in the other sheet and it does loop through 4 times. However,
there seems to be NOTHING in RosRng.Range("D1").Value. It will not light up
in the debugger either which leads me to believe that something ain't quite
right.
Can someone please shed some light on what I may be doing wrong.
Also, can someone tell me how to set current row. If I find the above value
in say, row 7, how can I postion to that row or even column.
Thanks a bunch!!
Reno
Been staring at this code for days, and am frankly lost. Not really an Excel
programmer but cobbled this together from samples and research. All I wish
to do is to take a value from one sheet and position to that same value in
another sheet, and then set the row in the sheet to current row. Here is the
code....
Sub current_Cell()
MsgBox ActiveCell.Value
For Each RosRng In Sheets("sheet2").UsedRange.Rows
If RosRng.Range("D1").Value = ActiveCell.Value Then
MsgBox "gotit"
End If
Next
End Sub
I have 4 rows in the other sheet and it does loop through 4 times. However,
there seems to be NOTHING in RosRng.Range("D1").Value. It will not light up
in the debugger either which leads me to believe that something ain't quite
right.
Can someone please shed some light on what I may be doing wrong.
Also, can someone tell me how to set current row. If I find the above value
in say, row 7, how can I postion to that row or even column.
Thanks a bunch!!
Reno