ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting rows (https://www.excelbanter.com/excel-programming/318523-selecting-rows.html)

JT[_2_]

Selecting rows
 
I want to select rows. However, the first row will always
be different, so I am trying to use a variable. Here is
the code that is not working:


Dim vlastrow As Integer
vlastrow = Cells.SpecialCells(xlCellTypeLastCell).Row
FIRSTROW = vlastrow + 1
Rows((FIRSTROW), "65000").EntireRow.Select

Any suggestions would be appreciated. Thanks for the help.

Norman Jones

Selecting rows
 
Hi JT,

Try:

Sub Tester03()
Dim FirstRow As Long

FirstRow = Cells.SpecialCells(xlCellTypeLastCell).Row + 1
Rows(FirstRow).Resize(Rows.Count - FirstRow + 1).Select

End Sub

Note that it is rarely necessary to make physical range selections.

---
Regards,
Norman



"JT" wrote in message
...
I want to select rows. However, the first row will always
be different, so I am trying to use a variable. Here is
the code that is not working:


Dim vlastrow As Integer
vlastrow = Cells.SpecialCells(xlCellTypeLastCell).Row
FIRSTROW = vlastrow + 1
Rows((FIRSTROW), "65000").EntireRow.Select

Any suggestions would be appreciated. Thanks for the help.





All times are GMT +1. The time now is 01:11 PM.

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