Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i am trying to replace a cell reference with a variable and cannot seem to
figure it out. here's specifically what i'm trying to accomplish i have a dropdown with 4 selections, let's say the user selects totals i set a variable, sColumn to Q4 if that cell contains "totals", so sColumn = Q4 then when i sort using this formula, Worksheets("Sheet1").Range("B5:Q18").Sort _ Key1:=Worksheets("Rankings").Range("XX") how do i get the value from sColumn to where the "XX's are? (the placeholders for this email) thanks for any help -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary,
i haven't tried it but maybe Key1:=Worksheets("Rankings").Range(" & sColumn & ") "Gary Keramidas" wrote: i am trying to replace a cell reference with a variable and cannot seem to figure it out. here's specifically what i'm trying to accomplish i have a dropdown with 4 selections, let's say the user selects totals i set a variable, sColumn to Q4 if that cell contains "totals", so sColumn = Q4 then when i sort using this formula, Worksheets("Sheet1").Range("B5:Q18").Sort _ Key1:=Worksheets("Rankings").Range("XX") how do i get the value from sColumn to where the "XX's are? (the placeholders for this email) thanks for any help -- Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i think i missed a couple quotes
Key1:=Worksheets("Rankings").Range("" & sColumn & "") should work "Gixxer_J_97" wrote: Hi Gary, i haven't tried it but maybe Key1:=Worksheets("Rankings").Range(" & sColumn & ") "Gary Keramidas" wrote: i am trying to replace a cell reference with a variable and cannot seem to figure it out. here's specifically what i'm trying to accomplish i have a dropdown with 4 selections, let's say the user selects totals i set a variable, sColumn to Q4 if that cell contains "totals", so sColumn = Q4 then when i sort using this formula, Worksheets("Sheet1").Range("B5:Q18").Sort _ Key1:=Worksheets("Rankings").Range("XX") how do i get the value from sColumn to where the "XX's are? (the placeholders for this email) thanks for any help -- Gary |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
that seems to work, thanks a lot. i was trying all different combinations of
double quotes and couldn't get it to work. i also tried the ampersand, but not how you have it in your combo. thanks again -- Gary "Gixxer_J_97" wrote in message ... i think i missed a couple quotes Key1:=Worksheets("Rankings").Range("" & sColumn & "") should work "Gixxer_J_97" wrote: Hi Gary, i haven't tried it but maybe Key1:=Worksheets("Rankings").Range(" & sColumn & ") "Gary Keramidas" wrote: i am trying to replace a cell reference with a variable and cannot seem to figure it out. here's specifically what i'm trying to accomplish i have a dropdown with 4 selections, let's say the user selects totals i set a variable, sColumn to Q4 if that cell contains "totals", so sColumn = Q4 then when i sort using this formula, Worksheets("Sheet1").Range("B5:Q18").Sort _ Key1:=Worksheets("Rankings").Range("XX") how do i get the value from sColumn to where the "XX's are? (the placeholders for this email) thanks for any help -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Value Replacement | Excel Worksheet Functions | |||
#N/A Replacement | Excel Discussion (Misc queries) | |||
Replacement | Excel Discussion (Misc queries) | |||
Replacement CD | Excel Programming | |||
Bad Office CD -- how do I get a replacement. | Excel Programming |