Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, I'm one step further then my last question. How do I SORT using string
variables? Am I close? dim itype1 as integer dim itype2 as integer dim itype3 as interger itype1 = "Cash Equivalent" itype2 = "Bond" itype3 = "Common Stock" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim itype1 as integer
dim itype2 as integer dim itype3 as interger Dim res1 as variant, res2 as variant, res3 as variant Dim rng1 as Range, rng2 as Range, rng3 as Range itype1 = "Cash Equivalent" itype2 = "Bond" itype3 = "Common Stock" res1 = Application.Match(itype1,Rows(1),0) res2 = Application.Match(itype2,Rows(1),0) res3 = Application.Match(itype2,Rows(1),0) if not iserror(res1) and not iserror(res2) and not iserror(res3) then set rng1 = cells(1,res1) set rng2 = cells(1,res2) set rng3 = cells(1,res3) Range("A1").currentRegion.Sort _ Key1:=rng1, order1:=xlAscending, _ Key2:=rng2, order2:=xlAscending, _ Key3:=rng3, order3:=xlAscending, _ Header:=xlYes,OrderCustom:=1, _ MatchCase:=False, Orientation:=xlTopToBottom -- Regards, Tom Ogilvy "SharonInGa" wrote in message ... OK, I'm one step further then my last question. How do I SORT using string variables? Am I close? dim itype1 as integer dim itype2 as integer dim itype3 as interger itype1 = "Cash Equivalent" itype2 = "Bond" itype3 = "Common Stock" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sort by two variables at the same time | Excel Worksheet Functions | |||
How do I sort variables into sets of three? | Excel Discussion (Misc queries) | |||
How do I sort a column of computed variables in EXCEL? | Excel Worksheet Functions | |||
Sort with two variables | New Users to Excel | |||
sort for variables | Excel Programming |