return row number

jasmith

New Member
Joined
Oct 24, 2005
Messages
21
I have data in column one rows 3 thru 9
I am on row 3 and I want to stop at row 6

I have a macro as follows:
dim r as integer
do while r <> 3

activecell.next(2,0).select

r=Row(activecell)
loop

The point here is that I am unsure of my r=Row(activecell)
I thought that there was a function that would return the integer
value of the row of the active cell, but I could not find it.

Does anybody know how to return the row number?

Thanks in advance
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

jasmith

New Member
Joined
Oct 24, 2005
Messages
21
The above macro is flawed:

the code should read :

Do while r <> 6

Thanks!!!!!!
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hello, jasmith,
Does anybody know how to return the row number?
RowNumber = ActiveCell.Row

do you really need to select those cells ?
you can do operations without selecting cells
like this: Cells(1, 1) = 456

kind regards,
Erik
 

jasmith

New Member
Joined
Oct 24, 2005
Messages
21
THanks for the reply - - and I learned something new

I learned it this way from trial and error and just kept using the activecellmethod.- I did'nt know that
you could use the Cells method.

Thanks
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,990
Messages
5,834,761
Members
430,318
Latest member
ZackChua95

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
Top