Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-29-2018, 12:36 PM
Chayes Chayes is offline Select all cells in a column , even when blank... Windows XP Select all cells in a column , even when blank... Office 2003
Advanced Beginner
Select all cells in a column , even when blank...
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 05-29-2018, 07:56 PM
Logit Logit is offline Select all cells in a column , even when blank... Windows 10 Select all cells in a column , even when blank... Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Code:
Option Explicit

Sub selectallrows()
     Worksheets("Sheet1").Activate
     ActiveSheet.UsedRange.Select
End Sub
Reply With Quote
  #3  
Old 05-29-2018, 08:32 PM
NoSparks NoSparks is offline Select all cells in a column , even when blank... Windows 7 64bit Select all cells in a column , even when blank... Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

determine the 'last row' separately
Code:
lr = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
Range(ActiveCell, Cells(lr, ActiveCell.Column)).Select
Reply With Quote
  #4  
Old 05-30-2018, 06:01 AM
Chayes Chayes is offline Select all cells in a column , even when blank... Windows XP Select all cells in a column , even when blank... Office 2003
Advanced Beginner
Select all cells in a column , even when blank...
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

Hi All


Ok thanks for this. It's solved the issue and is working perfectly now.




Very Best Wishes ,
Reply With Quote
  #5  
Old 05-30-2018, 10:35 AM
Logit Logit is offline Select all cells in a column , even when blank... Windows 10 Select all cells in a column , even when blank... Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

You are welcome.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select all cells in a column , even when blank... 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft