Kind of like offset.....

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

Guest

Say I have the following variables

myVar1 = 1
myVar2 = Sheet("sheet1").Range("B5")

how do I get myVar2 to equal Sheet("sheet1").Range("C5") using myVar1

also;

how do I get myVar2 to equal Sheet("sheet1").Range("B6") using myVar1

Bruce
 
Hi
try:
myVar2=Sheet("sheet1").Range("B5").offset(0,myvar1).value

and
myVar2=Sheet("sheet1").Range("B5").offset(myvar1,0).value
 

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