#1
|
|||
|
|||
Select all cells in a column , even when blank...
Hi All
I use this code to select all of the cells from the active one down to the bottom of the column : Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select However , if the last few cells of the particular column happen to be blank , it doesn't select them. Can someone help with a way to modify the code so that all cells in the column are selected to the bottom , irrespective of being blank or not? It needs somehow to find bottom-most cell of the whole sheet and then select to there , rather than solely in the specific column in question. Grateful for any advice. |
#2
|
|||
|
|||
Code:
Option Explicit Sub selectallrows() Worksheets("Sheet1").Activate ActiveSheet.UsedRange.Select End Sub |
#3
|
|||
|
|||
determine the 'last row' separately
Code:
lr = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row Range(ActiveCell, Cells(lr, ActiveCell.Column)).Select |
#4
|
|||
|
|||
Hi All
Ok thanks for this. It's solved the issue and is working perfectly now. Very Best Wishes , |
#5
|
|||
|
|||
You are welcome.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Vlookup fill down blank cells in column | mbesspiata | Excel Programming | 8 | 09-26-2016 04:44 AM |
Auto Fill only Blank Cells in a Column | mbesspiata3 | Excel Programming | 1 | 09-22-2016 07:18 PM |
Return Sum value of one column from cells not blank in another column | zulugandalf | Excel | 3 | 08-14-2014 03:37 AM |