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!! =)
 

daveydoom

Trusted Advisor
Joined
Oct 8, 2005
Messages
115
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top