Offset Prob

  • Thread starter Thread starter Edgar
  • Start date Start date
E

Edgar

Hi

I am trying to name the variable name1 by an offset of
range a1 by a1 rows and 1 column.

But the following codes not working can anyone help me?

TIa

Sub TestName()

drp = Range("A1")
name1 = Worksheets("control").Range(drp).Offset(drp, 1)
MsgBox (name)

End Sub
 
So if A1 = 1
and B2 = hello world
then it should display hello world

Sub TestName()
With Worksheets("control").Range("A1")
MsgBox .Offset(.Value, 1)
End With
End Sub
 

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