Sort Data for duplicates

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

Guest

I would like some code that will sort my data based on column B. I do not
want to delete the duplicates, just have them togetherfor this macro.

I would like a seperate macro just to delte the dups based on column B

Thanks.
I want to see the steps for future improvement in the code
 
Already added to your last post...

Public Sub SortStuff()
Dim wks As Worksheet
Dim rng As Range

Set wks = ActiveSheet
Set rng = wks.Cells

rng.Sort Key1:=wks.Range("B2"), Order1:=xlAscending, Header:=xlYes

Set wks = Nothing
Set rng = Nothing
End Sub
 
Thanks

Jim Thomlinson said:
Already added to your last post...

Public Sub SortStuff()
Dim wks As Worksheet
Dim rng As Range

Set wks = ActiveSheet
Set rng = wks.Cells

rng.Sort Key1:=wks.Range("B2"), Order1:=xlAscending, Header:=xlYes

Set wks = Nothing
Set rng = Nothing
End Sub
 

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