Sorting a sheet in VBA

  • Thread starter Thread starter Sonnich Jensen
  • Start date Start date
S

Sonnich Jensen

Hi

I seem to have problems with this - I have a sheet of 2 coloums as

A = string, B = number, given as =1+2+3+.....

Now, I want to sort by the number, therefore:

sh2.Range("B:B").Sort Key1:=sh2.Range("B:B"), Order1:=xlAscending,
Orientation:=xlSortRows
sh2 = worksheet

However, that does not really work.... what do I do wrong?

WBR
Sonnich
 
What does "does not really work" mean?
How is "sh2" established as a worksheet?

Do you do something like...
Dim sh2 as Worksheet
Set sh2 = Worksheets("Sludge")
--
Jim Cone
Portland, Oregon USA .
http://www.contextures.com/excel-sort-addin.html .
(editorial review of special sort excel add-in (30 ways to sort)




"Sonnich Jensen"
<[email protected]>
wrote in message
news:1a262da0-6352-4459-a98a-c8138bdf6ab0@gk10g2000vbb.googlegroups.com...
 
Back
Top