PC Review


Reply
Thread Tools Rate Thread

A1 reference style

 
 
T. Valko
Guest
Posts: n/a
 
      18th Dec 2006
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


 
Reply With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      18th Dec 2006
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.
>>Application.Goto Reference:="INDIRECT(R1C1)"


Thanks
Biff

"Martin Fishlock" <(E-Mail Removed)> wrote in message
news:390A509A-52B6-4506-8244-(E-Mail Removed)...
> Biff,
>
> Goto requires a range object. There you need to do the following:
>
> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Cells(1, 1))
>
> 'or
>
> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Range("A1"))
>
> But it may be easier just to do thew following:
>
> range(ActiveSheet.Range("A1")).select
>
> --
> Hope this helps
> Martin Fishlock
> Please do not forget to rate this reply.
>
>
> "T. Valko" wrote:
>
>> 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
>>
>>
>>



 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      18th Dec 2006
ooops!

Disregard the last post.

It does in fact work just fine.

Thanks, Martin!

Biff

"T. Valko" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>>>Application.Goto Reference:="INDIRECT(R1C1)"

>
> Thanks
> Biff
>
> "Martin Fishlock" <(E-Mail Removed)> wrote in message
> news:390A509A-52B6-4506-8244-(E-Mail Removed)...
>> Biff,
>>
>> Goto requires a range object. There you need to do the following:
>>
>> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Cells(1, 1))
>>
>> 'or
>>
>> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Range("A1"))
>>
>> But it may be easier just to do thew following:
>>
>> range(ActiveSheet.Range("A1")).select
>>
>> --
>> Hope this helps
>> Martin Fishlock
>> Please do not forget to rate this reply.
>>
>>
>> "T. Valko" wrote:
>>
>>> 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
>>>
>>>
>>>

>
>



 
Reply With Quote
 
=?Utf-8?B?UGFwYURvcw==?=
Guest
Posts: n/a
 
      18th Dec 2006
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...

--
Regards,
Luc.

"Festina Lente"


"T. Valko" wrote:

> ooops!
>
> Disregard the last post.
>
> It does in fact work just fine.
>
> Thanks, Martin!
>
> Biff
>
> "T. Valko" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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.
> >>>Application.Goto Reference:="INDIRECT(R1C1)"

> >
> > Thanks
> > Biff
> >
> > "Martin Fishlock" <(E-Mail Removed)> wrote in message
> > news:390A509A-52B6-4506-8244-(E-Mail Removed)...
> >> Biff,
> >>
> >> Goto requires a range object. There you need to do the following:
> >>
> >> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Cells(1, 1))
> >>
> >> 'or
> >>
> >> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Range("A1"))
> >>
> >> But it may be easier just to do thew following:
> >>
> >> range(ActiveSheet.Range("A1")).select
> >>
> >> --
> >> Hope this helps
> >> Martin Fishlock
> >> Please do not forget to rate this reply.
> >>
> >>
> >> "T. Valko" wrote:
> >>
> >>> 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
> >>>
> >>>
> >>>

> >
> >

>
>
>

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      18th Dec 2006
>Application.Goto Reference:=activesheet.range("a1")

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

Biff

"PapaDos" <(E-Mail Removed)> wrote in message
news:E49E3912-B175-4603-869D-(E-Mail Removed)...
> 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...
>
> --
> Regards,
> Luc.
>
> "Festina Lente"
>
>
> "T. Valko" wrote:
>
>> ooops!
>>
>> Disregard the last post.
>>
>> It does in fact work just fine.
>>
>> Thanks, Martin!
>>
>> Biff
>>
>> "T. Valko" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>> > 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.
>> >>>Application.Goto Reference:="INDIRECT(R1C1)"
>> >
>> > Thanks
>> > Biff
>> >
>> > "Martin Fishlock" <(E-Mail Removed)> wrote in
>> > message
>> > news:390A509A-52B6-4506-8244-(E-Mail Removed)...
>> >> Biff,
>> >>
>> >> Goto requires a range object. There you need to do the following:
>> >>
>> >> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Cells(1, 1))
>> >>
>> >> 'or
>> >>
>> >> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Range("A1"))
>> >>
>> >> But it may be easier just to do thew following:
>> >>
>> >> range(ActiveSheet.Range("A1")).select
>> >>
>> >> --
>> >> Hope this helps
>> >> Martin Fishlock
>> >> Please do not forget to rate this reply.
>> >>
>> >>
>> >> "T. Valko" wrote:
>> >>
>> >>> 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
>> >>>
>> >>>
>> >>>
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      20th Dec 2006
Ok, that works!

Thanks

Biff

"PapaDos" <(E-Mail Removed)> wrote in message
news:0D1E6FC0-B6C8-4E04-8535-(E-Mail Removed)...
> 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"
>
>
> "T. Valko" wrote:
>
>> >Application.Goto Reference:=activesheet.range("a1")

>>
>> That doesn't work. It just selects cell A1.
>>
>> Biff
>>
>> "PapaDos" <(E-Mail Removed)> wrote in message
>> news:E49E3912-B175-4603-869D-(E-Mail Removed)...
>> > 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...
>> >
>> > --
>> > Regards,
>> > Luc.
>> >
>> > "Festina Lente"
>> >
>> >
>> > "T. Valko" wrote:
>> >
>> >> ooops!
>> >>
>> >> Disregard the last post.
>> >>
>> >> It does in fact work just fine.
>> >>
>> >> Thanks, Martin!
>> >>
>> >> Biff
>> >>
>> >> "T. Valko" <(E-Mail Removed)> wrote in message
>> >> news:%(E-Mail Removed)...
>> >> > 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.
>> >> >>>Application.Goto Reference:="INDIRECT(R1C1)"
>> >> >
>> >> > Thanks
>> >> > Biff
>> >> >
>> >> > "Martin Fishlock" <(E-Mail Removed)> wrote in
>> >> > message
>> >> > news:390A509A-52B6-4506-8244-(E-Mail Removed)...
>> >> >> Biff,
>> >> >>
>> >> >> Goto requires a range object. There you need to do the following:
>> >> >>
>> >> >> Application.Goto Reference:=ActiveSheet.Range(ActiveSheet.Cells(1,
>> >> >> 1))
>> >> >>
>> >> >> 'or
>> >> >>
>> >> >> Application.Goto
>> >> >> Reference:=ActiveSheet.Range(ActiveSheet.Range("A1"))
>> >> >>
>> >> >> But it may be easier just to do thew following:
>> >> >>
>> >> >> range(ActiveSheet.Range("A1")).select
>> >> >>
>> >> >> --
>> >> >> Hope this helps
>> >> >> Martin Fishlock
>> >> >> Please do not forget to rate this reply.
>> >> >>
>> >> >>
>> >> >> "T. Valko" wrote:
>> >> >>
>> >> >>> 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
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >
>> >> >
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Microsoft Excel Worksheet Functions 1 13th Sep 2007 09:02 AM
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Microsoft Excel Programming 1 13th Sep 2007 09:02 AM
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Microsoft Excel Misc 1 13th Sep 2007 09:02 AM
can a1 reference style and r1c1 style be used in same formula? =?Utf-8?B?cmphZ2dh?= Microsoft Excel Worksheet Functions 2 17th Sep 2006 10:58 AM
can a1 reference style and r1c1 style be used in same formula? =?Utf-8?B?cmphZ2dh?= Microsoft Excel Worksheet Functions 0 17th Sep 2006 09:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 PM.