Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting a sheet in VBA
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, therefo 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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting a sheet in VBA
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" wrote in message ... 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, therefo 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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting a sheet in VBA
Maybe you want to sort both columns A and B???
sh2.range("a:b").sort ..... On 10/24/2011 10:22, Sonnich Jensen wrote: 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, therefo 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting Data from a different sheet | Excel Worksheet Functions | |||
Sorting sheet that contains lookups | Excel Discussion (Misc queries) | |||
Sorting a sheet by VBA | Excel Discussion (Misc queries) | |||
SORTING TO ANOTHER SHEET | Excel Discussion (Misc queries) | |||
Sorting a sheet | Excel Worksheet Functions |