Problem with code about ranges

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

Guest

I have the following code that is not acting as I was hoping it would:

Dim SelectedRange As Range, RangeCheck As Range

Set SelectedRange = Sheet1.Range("C2:C10")
SelectedRange.Select
For Each RangeCheck In SelectedRange
Range(RangeCheck).Select

When I use the SelectedRange.Select command it selects the correct command,
but when it gets to the Range(RangeCheck).Select is selects cell AR644
instead of the first cell in the given range.

What am I doing wrong??

Any help would be greatly appreciated.

cdb
 
Hi cdb,

Try:

RangeCheck.Select

you don't need to do Range(RangeCheck) as RangeCheck is already a range and
not the name of the range (i.e.text string)

Regards,
KL
 
KL,

Works perfectly - thanks a lot.

cdb

KL said:
Hi cdb,

Try:

RangeCheck.Select

you don't need to do Range(RangeCheck) as RangeCheck is already a range and
not the name of the range (i.e.text string)

Regards,
KL
 

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