Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using variable as cell location

how can I us a variable as a cell location? ie
Range("c5:variable").Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default using variable as cell location

Brad,

Not sure if I understand you (and let me know if this is not what you were
asking), but all you need to do to use a variable as the parameter for the
Range object:

Dim sCell As String
sCell = "c5"

Range(sCell).Select

--
Charles
www.officezealot.com


"Brad" wrote in message
...
how can I us a variable as a cell location? ie
Range("c5:variable").Select



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default using variable as cell location

You can use this Brad

Var = 10
Range("c5:c" & Var).Select

or

Var = "C10"
Range("c5:" & Var).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Brad" wrote in message ...
how can I us a variable as a cell location? ie
Range("c5:variable").Select



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default using variable as cell location

Range(C5).Select

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Brad" wrote in message
...
how can I us a variable as a cell location? ie
Range("c5:variable").Select



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default using variable as cell location

AH! Now I see what the OPS meant.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Ron de Bruin" wrote in message
...
You can use this Brad

Var = 10
Range("c5:c" & Var).Select

or

Var = "C10"
Range("c5:" & Var).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Brad" wrote in message

...
how can I us a variable as a cell location? ie
Range("c5:variable").Select







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default using variable as cell location

Brad,

It depends on what the variable contains. If it is a string
variable with an address, you can use something like

Range("C5:" & Var).Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Brad" wrote in message
...
how can I us a variable as a cell location? ie
Range("c5:variable").Select



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
Using a variable to point to a location John[_29_] Excel Worksheet Functions 2 August 25th 09 07:27 PM
how to set up a simple variable in Excel, but cell location independent Alberta K. New Users to Excel 3 December 19th 07 03:55 PM
how to set up a simple variable in Excel, but cell location independent Alberta K. Excel Worksheet Functions 3 December 19th 07 03:55 PM
Set a range from a variable location Troubled User Excel Discussion (Misc queries) 2 November 27th 05 12:05 AM
join location string with variable igor Excel Programming 4 August 27th 03 02:46 AM


All times are GMT +1. The time now is 03:52 PM.

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

About Us

"It's about Microsoft Excel"