ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Selecting Rows (https://www.excelbanter.com/excel-worksheet-functions/41645-selecting-rows.html)

Coolboy55

Selecting Rows
 

I want to select rows 3 to l_LastRow. I can't say Rows("3:l_LastRow"),
so what are my alternatives? Thanks!

This is what I have:

----------
l_LastRow = Sheet4.Cells.Find(What:=" * ", After:=[A1],
SearchDirection:=xlPrevious).Row

Sheet4.Rows("3:l_LastRow").Select
----------


--
Coolboy55
------------------------------------------------------------------------
Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
View this thread: http://www.excelforum.com/showthread...hreadid=397766


hideki


Did you mean want to select a row three row after the last row?

Sheets("Sheet4").Rows(lngLastRow + 3).Select


--
hideki
------------------------------------------------------------------------
hideki's Profile: http://www.excelforum.com/member.php...o&userid=18903
View this thread: http://www.excelforum.com/showthread...hreadid=397766


Coolboy55


I want to select rows 3 to lngLastRow (in this case, lngLastRow = 203).
But the value of lngLastRow may change in the future as items in the
table I'm creating are modified.


--
Coolboy55
------------------------------------------------------------------------
Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
View this thread: http://www.excelforum.com/showthread...hreadid=397766


Coolboy55


I also will want to use xlLastCell to pick a range, as in,
Range("B3:xlLastCell"). How can I do that?

I'm basically creating a table for my data, along with background
shading. The data in the table will change occasionally, so the
borders and shading will need to be reapplied and resized as
necessary.

Am I doing it wrong?


--
Coolboy55
------------------------------------------------------------------------
Coolboy55's Profile: http://www.excelforum.com/member.php...o&userid=26508
View this thread: http://www.excelforum.com/showthread...hreadid=397766


hideki


So you want to select the range from B3 to the last cell? I think you
can try this syntax.

Range(Cells(3, "B"), Cells.SpecialCells(xlCellTypeLastCell)).Select


--
hideki
------------------------------------------------------------------------
hideki's Profile: http://www.excelforum.com/member.php...o&userid=18903
View this thread: http://www.excelforum.com/showthread...hreadid=397766



All times are GMT +1. The time now is 04:55 PM.

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