ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Incrementing row number (https://www.excelbanter.com/excel-programming/358429-incrementing-row-number.html)

den1s

Incrementing row number
 
Is there a command that simply increments the row number?

I know you can use the command cells(x,x) to select the specific cell
but I would like to increment the row number, without prior knowledge
of where I was.

Also is there a command that returns the current active cell?

- D


Gary Keramidas

Incrementing row number
 
maybe something like this

Option Explicit
Dim rNum As Long
Sub next_row()
rNum = ActiveCell.Row + 1
Debug.Print rNum
End Sub

--


Gary


"den1s" wrote in message
oups.com...
Is there a command that simply increments the row number?

I know you can use the command cells(x,x) to select the specific cell
but I would like to increment the row number, without prior knowledge
of where I was.

Also is there a command that returns the current active cell?

- D




Carim[_7_]

Incrementing row number
 

Hi Denis,

Your two questions are very related ...
ActiveCell.Row would give you the row number of the active cell
and
ActiveCell.Offset(1,0) does increment the row by 1 and the column by 0
....

HTH
Carim


--
Carim
------------------------------------------------------------------------
Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
View this thread: http://www.excelforum.com/showthread...hreadid=531295


Tom Ogilvy

Incrementing row number
 
Just to add to Carim's post
ActiveCell.offset(1,0).Select

selects the next cell down from the currently selected cell.

--
Regards,
Tom Ogilvy


"den1s" wrote in message
oups.com...
Is there a command that simply increments the row number?

I know you can use the command cells(x,x) to select the specific cell
but I would like to increment the row number, without prior knowledge
of where I was.

Also is there a command that returns the current active cell?

- D





All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com