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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,216,107
Messages
6,128,870
Members
449,475
Latest member
Parik11

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