ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I get the row number? (https://www.excelbanter.com/excel-programming/436154-how-do-i-get-row-number.html)

Jock

How do I get the row number?
 
Hi,
The code snippet below will copy data from a certain row plus other info to
a different sheet.
I would like it to include the row number (at the end) of the row copied
from for ease of identification in the future. Any ideas welcomed.

.Range("B" & lngNewRow).Value = Sheets("claims").Range("D" & lngRowNo)
.Range("C" & lngNewRow).Value = Sheets("claims").Range("E" & lngRowNo)
.Range("H" & lngNewRow).Value = UserForm8.TextBox1.Text
.Range("I" & lngNewRow).Value = UserName()
.Range("J" & lngNewRow).Value = Format(Date, "dd mmm")
.Range("K" & lngNewRow).Value = Format(Time, "hh:mm")
.Range("L" & lngNewRow).Value = rownumber()

Thanks
--
Traa Dy Liooar

Jock

Mike H

How do I get the row number?
 
Jock,

Isn't it lngRowNo you want

..Range("L" & lngNewRow).Value = lngRowNo


Mike

"Jock" wrote:

Hi,
The code snippet below will copy data from a certain row plus other info to
a different sheet.
I would like it to include the row number (at the end) of the row copied
from for ease of identification in the future. Any ideas welcomed.

.Range("B" & lngNewRow).Value = Sheets("claims").Range("D" & lngRowNo)
.Range("C" & lngNewRow).Value = Sheets("claims").Range("E" & lngRowNo)
.Range("H" & lngNewRow).Value = UserForm8.TextBox1.Text
.Range("I" & lngNewRow).Value = UserName()
.Range("J" & lngNewRow).Value = Format(Date, "dd mmm")
.Range("K" & lngNewRow).Value = Format(Time, "hh:mm")
.Range("L" & lngNewRow).Value = rownumber()

Thanks
--
Traa Dy Liooar

Jock



All times are GMT +1. The time now is 09:39 AM.

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