VBA sort does not work

G

Guest

Hi,

i have code below to sort a range in my worksheet but it doesn't work
however i can sort it by manually

Sheets(1).Range("A" & Trim(Str(strt)) & ":Q" & Trim(Str(endd -
1))).Select
Selection.Sort Key1:=Range("A" & Trim(Str(strt))),
Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

i am stock on this problem please help.

Thanks,
 
G

Guest

Hi Don,

Thank you for your respond but i found it in the Header:=xlYes i should
choos Header:=xlNo

Regards,
 

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