Excel Help with Excel VBA

Joined
Dec 11, 2009
Messages
1
Reaction score
0
Hi, I'm very new to programming...

Right now I'm writing Excel macros that will sort data in accending order.

From the macro recording I have:
Range("A1:T19").Select
Range("T19").Activate
Selection.sort Key1:=Range("T19"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

However, I want to unselect the rows if the value for first cell of that row (Cells(x,1)) is empty. So that only the row where Range("Ax")<>Empty are selected.

I tried using variables and if... then commands but none worked. Any ideas? Thanks in advance!! =)
 
If you're saying you want to exlcude rows where the first cell in column A is empty, just sort by column A so that all empty cells in column A are at the bottom.

Then continue to work with the rest of the data.
 
Back
Top