swjtx99
asked on
Select all data in a column that has blank cells
Hi,
I have a macro that copies a column from one sheet to another.
Column A has no blanks but column B does.
When I use the following to copy, it only selects data down to the first blank cell instead of the entire column.
Sheets("test1").Select
Range("B1").Select
Range(Selection, Selection.End(xlDown)).Sel ect
Application.CutCopyMode = False
Selection.Copy
Sheets("test2").Select
Range("B1").Select
ActiveSheet.Paste
I'm guessing the best way is to set a "range" which would be the number of rows with data in column A, then use that range value to copy columns that have blank cells but haven't found a good useable example googling.
Thanks in advance,
swjtx99
I have a macro that copies a column from one sheet to another.
Column A has no blanks but column B does.
When I use the following to copy, it only selects data down to the first blank cell instead of the entire column.
Sheets("test1").Select
Range("B1").Select
Range(Selection, Selection.End(xlDown)).Sel
Application.CutCopyMode = False
Selection.Copy
Sheets("test2").Select
Range("B1").Select
ActiveSheet.Paste
I'm guessing the best way is to set a "range" which would be the number of rows with data in column A, then use that range value to copy columns that have blank cells but haven't found a good useable example googling.
Thanks in advance,
swjtx99
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. Looks like that works!
Regards,
swjtx99