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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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