Why does this work in a macro but not in the code for a button?
"Range("B3:C3").Select"

Re: Excel Button select range by Ron

Ron
Thu Jul 01 10:33:47 CDT 2004

Hi Randal

Do you use Excel 97?

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Randal" <rlwnrAThighstream.net> wrote in message news:OQlRA63XEHA.2408@tk2msftngp13.phx.gbl...
> Why does this work in a macro but not in the code for a button?
> "Range("B3:C3").Select"
>
>



Re: Excel Button select range by Randal

Randal
Thu Jul 01 10:39:30 CDT 2004

Excel 2000 (9.0.6926 SP-3)

"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message
news:e7G6SD4XEHA.3972@TK2MSFTNGP12.phx.gbl...
> Hi Randal
>
> Do you use Excel 97?
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "Randal" <rlwnrAThighstream.net> wrote in message
news:OQlRA63XEHA.2408@tk2msftngp13.phx.gbl...
> > Why does this work in a macro but not in the code for a button?
> > "Range("B3:C3").Select"
> >
> >
>
>



Re: Excel Button select range by Ron

Ron
Thu Jul 01 12:30:05 CDT 2004

Hi Randal

Do you get a error message ?

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Randal" <rlwnrAThighstream.net> wrote in message news:OBY$fG4XEHA.3716@TK2MSFTNGP10.phx.gbl...
> Excel 2000 (9.0.6926 SP-3)
>
> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message
> news:e7G6SD4XEHA.3972@TK2MSFTNGP12.phx.gbl...
> > Hi Randal
> >
> > Do you use Excel 97?
> >
> > --
> > Regards Ron de Bruin
> > http://www.rondebruin.nl
> >
> >
> > "Randal" <rlwnrAThighstream.net> wrote in message
> news:OQlRA63XEHA.2408@tk2msftngp13.phx.gbl...
> > > Why does this work in a macro but not in the code for a button?
> > > "Range("B3:C3").Select"
> > >
> > >
> >
> >
>
>



Re: Excel Button select range by Dave

Dave
Thu Jul 01 17:42:03 CDT 2004

I'm betting that you changed worksheets:

Try something like:

with worksheets("othersheet")
.select
.range("b3:c3").select
....


If your code is for a command button from the controltoolbox tooblar on a
worksheet:

Then unqualified refences like the range refence in this example:

worksheets("othersheet").select
range("b3:c3").select

will refer to the worksheet that holds the code. (The same code in a general
module will use the activesheet.)

And you usually don't have to select the range before you do something with it.
Maybe just work on that range directly???



Randal wrote:
>
> Why does this work in a macro but not in the code for a button?
> "Range("B3:C3").Select"

--

Dave Peterson
ec35720@msn.com