Locating a cell within a macro

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

Guest

I have a lookup which gives me a cell ref in terms of R1C1 into cell A2
On the same sheet I have a value that I want to copy from Cell B2 into the
cell referenced to in A2.

I have a very basic knowledge of macros and not sure if this is possible.

Can anyone help?

thanks,

Ron.
 
Ron,

The macro is as below. The tricky bit is to conver the R1C1 style reference
to A1 style:

Sub IndirectCopy()
Const cCellValue As String = "B2"
Const cCellIndirect As String = "A1"
Dim sCell As String
sCell = Application.ConvertFormula(Range(cCellIndirect), _
xlR1C1, xlA1)
Range(sCell).Value = Range(cCellValue).Value
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