A1 reference style

  • Thread starter Thread starter T. Valko
  • Start date Start date
T

T. Valko

Hi folks!

Application.Goto Reference:="INDIRECT(R1C1)"

Why won't that accept an A1 reference?

Both of these fail:

Application.Goto Reference:="INDIRECT(A1)"
Application.Goto Reference:="INDIRECT("A1")"

Thanks
Biff
 
Martin,

I tried this:

Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Range("A1"))

I get a run-time error 1004

Let me further explain:

A1 contains a defined name like Product1. Product1 refers to cell A100. I
have the macro attached to a button. I click the button and are taken to
Product1 (cell A100).

It works just fine using the R1C1 reference but I'm trying to simplify it
for others who may be confused seeing R1C1.

P.S.: the line of code I posted was generated by the macro recorder.
Thanks
Biff
 
No need to create "range of range"

Application.Goto Reference:=activesheet.cells(1,1)

or

Application.Goto Reference:=activesheet.range("a1")

should work just fine...
 
Application.Goto Reference:=activesheet.range("a1")

That doesn't work. It just selects cell A1.

Biff
 
Ok, that works!

Thanks

Biff

PapaDos said:
LOL

Sorry, I misunderstood your need.

The fact that "INDIRECT(R1C1)" does work is a major surprise for me !
Then, a construct like this one would work too:

Application.Goto Reference:="indirect(" & range("a1").address(,,xlR1C1) &
")"


--
Regards,
Luc.

"Festina Lente"
 
Back
Top