Select entire column to the end that has blank cells

craigwojo

Active Member
Joined
Jan 7, 2005
Messages
274
Office Version
  1. 365
Platform
  1. Windows
Is there a shortcut to select a column that contains data, but has blank cells in between? I need the selection to end where the last cell with data is. I know of ctrl+shift+arrow down, but that stops where a blank cell is. I've seen others use shortcuts to contain many columns and then use the ctrl+arrow left (or right) to select only the column.
Is there just one shortcut to select the column containing blank and data cells to the end of the last cell that has data in it?

Thank you and God bless,
Craig
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I don't think there's anything built in, but you can use this macro and assign a shortcut key to it

VBA Code:
Sub SelectColumnData()
Dim sc As Long
sc = Selection.Column
Range(Cells(1, sc), Cells(Rows.Count, sc).End(xlUp)).Select
End Sub
 
Upvote 0
Solution
I don't think there's anything built in, but you can use this macro and assign a shortcut key to it

VBA Code:
Sub SelectColumnData()
Dim sc As Long
sc = Selection.Column
Range(Cells(1, sc), Cells(Rows.Count, sc).End(xlUp)).Select
End Sub
Thank you Scott.
 
Upvote 0
Thank you Scott.
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top