Determing a range from numerical data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to code the corresponding range of cells as the result of
numerical data without success.

What would be the code of the following example :
Range A12 to C22
A12 is known and C22 is the result of a counter that gives the number 22

Range("A22: ????? ).Select

Thanks for your help.
Moises
 
Can't really tell where you want the range to go.

But for starters (using R1C1 notation), adjust as needed.

Dim rng As Range
On Error Resume Next
Set rng = Range(Cells(Range("C22").Value, 1), Cells(Range("C35").Value, 3))
If Not rng Is Nothing Then
rng.Select
End If
 
Moises said:
I am trying to code the corresponding range of cells as the result of
numerical data without success.

What would be the code of the following example :
Range A12 to C22
A12 is known and C22 is the result of a counter that gives the number 22

Range("A22: ????? ).Select

Thanks for your help.
Moises

Range("A22:C"&counter).select should do it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top