How can you use Row() in a marco like this...

tim963

Board Regular
Joined
Aug 20, 2002
Messages
58
this does not work, excel 97. Thanks
sub test()
Dim r
r = row()
ActiveCell = 5 + r
End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
If you want to select the cell below five rows from the currently selected cell then

Cells(ActiveCell.Row + 5, ActiveCell.Column).Select

GNaga
 
Upvote 0
Andrew,

I appreciate that you were just sticking with the OP's original framework, but isn't the sub effectively just:

ActiveCell.Offset(0,5).Select

or, after clarification and using the other example GNaga

ActiveCell.Offset(0,5).Select


_________________<font color="blue"> «««<font color="red">¤<font color="blue"><font size=+1>Richie</font><font color="red">¤<font color="blue"> »»»</font>

caffeine_sample.gif
</gif>
This message was edited by Richie(UK) on 2002-09-10 06:12
 
Upvote 0
Richie,

Yes.

I stuck with the framework just to show him how to find the row.

Edit: And r is the row of the active cell not 0.
This message was edited by Andrew Poulsom on 2002-09-10 06:21
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top