Sorting a sheet in VBA

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
 
J

Jim Cone

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...
 

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