using variable as cell location

  • Thread starter Thread starter Brad
  • Start date Start date
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
 
You can use this Brad

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

or

Var = "C10"
Range("c5:" & Var).Select
 
AH! Now I see what the OPS meant.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel
 
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
 
Back
Top