Sorting Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Im using Visual Studio and I'm trying to sort by column D in ascending order
and sort all of the columns with it ("A3:CQ" & lastRow)

LCV.Range("D3:D" & lastRow).Sort(LCV.Range("A3:CW" & lastRow),
XlSortOrder.xlAscending, (LCV.Range("O3:O" & lastRow)

Its adding information at the end of my data in a new column, any ideas what
I'm doing wrong? Thanks!
 
Ok I figured out that I had to add in the extra arguments, but its still not
doing it right, its adding info. at then end of my data. Any ideas?

LCV.Range("A3:CW" & lastRow).Sort(LCV.Range("D3:D" & lastRow),
XlSortOrder.xlAscending, Header:=XlYesNoGuess.xlNo, MatchCase:=False,
Orientation:=XlSortOrientation.xlSortColumns,
SortMethod:=XlSortMethod.xlPinYin, DataOption1:=XlSortDataOption.xlSortNormal)
 

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

Back
Top