Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default variable replacement help please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default variable replacement help please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default variable replacement help please

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default variable replacement help please

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Value Replacement palups Excel Worksheet Functions 6 November 20th 09 02:38 AM
#N/A Replacement Susana C via OfficeKB.com Excel Discussion (Misc queries) 2 December 29th 06 05:06 PM
Replacement mowen Excel Discussion (Misc queries) 1 September 7th 05 09:01 PM
Replacement CD Greg Maloney Excel Programming 0 June 18th 04 11:29 AM
Bad Office CD -- how do I get a replacement. John Baker Excel Programming 2 December 7th 03 08:40 PM


All times are GMT +1. The time now is 08:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"