PDA

View Full Version : range name / reference



CathLavoie
10-26-2011, 05:55 AM
Hi!

I have a question about range name / reference.

In the cell A1 of the Sheet2 ("data"), I have a value expressed with a letter and a number. For example: H1. The value could change, it's not fixed so I can't refere to the value itself.

How can I select the cell of Sheet1 referenced in "data"? (in this example, selecting the cell H1 of Sheet1)

I have tried a couple of things with concatenate but it does not work.

Maybe someone could help me?
Thanks so much!

Aflatoon
10-26-2011, 06:27 AM
Assuming that you mean to do this in code:

With Sheets("Sheet1")
.Select
.Range(Sheets("data").Range("A1").Value).Select
End With

for example.

CathLavoie
10-26-2011, 07:08 AM
Thanks so much! It's working perfectly!
Now that I have selected the cell in Sheet1, I would like to copy-paste something in the cell. How could put this in variable? (CopyPasteDestination=variable)
I tried this but it does not work...

Dim Variable As Range
Coller = Sheets("Sheet1").Range(Sheets("data").Range("a1").Value)

Thanks again, this 1st answer helped me a lot!

Aflatoon
10-26-2011, 07:11 AM
In that case, there is no need to select it:
Sheets("Sheet1").Range(Sheets("data").Range("A1").Value).Value = variable