Re: Selecting



Your explanation of previous (which I dutifully re-read) did no good to one
such as me, Tom, who did not know -- yes, after all these years, did not
know :-( -- that you cannot select a range on a non-active ***.

Rowan's explanation did the trick.

Thanks all.

"Tom Ogilvy" <twogilvy@xxxxxxx> wrote in message
news:uuxETmIrFHA.2624@xxxxxxxxxxxxxxxxxxxxxxx
> Both statements are required. The change in behavior i cited is more
> restrictive, not less restrictive. Please re read the explanation.
>
> --
> Regards,
> Tom Ogilvy
>
> "William Benson" <wbenson1(SPAMSUCKS)@nycap.rr.com> wrote in message
> news:eSN5ebDrFHA.3604@xxxxxxxxxxxxxxxxxxxxxxx
>> Tom, are you saying that writing
>> Worksheets("PositionImports").Range("Positions").Select
>> resolves the problem? I suppose this makes selecting the work*** with
>> Worksheets("PositionImports").Select not of any (known) use in this
> context?
>>
>> Bill
>>
>>
>>
>>
>> "Tom Ogilvy" <twogilvy@xxxxxxx> wrote in message
>> news:uNpT9xCrFHA.3060@xxxxxxxxxxxxxxxxxxxxxxx
>> > Worksheets("PositionImports").Select
>> > Worksheets("PositionImports").Range("Positions").Select
>> >
>> > Assumes Range("Positions") is on *** PositionImports.
>> >
>> > I assume you are running this with a command button or in any event the
>> > code
>> > is in a *** module. In such cases, the unqualified
>> > Range("Positions")
>> > is
>> > implicitly qualified by the *** containing the code module. Since it
> is
>> > not on that ***, you get the error. Explicitly qualifying it removes
>> > that
>> > problem.
>> >
>> > --
>> > Regards,
>> > Tom Ogilvy
>> >
>> >
>> >
>> > "Mark Petruszak" <MarkPetruszak@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
>> > message
>> > news:CB0A075F-4599-4913-8B51-A4270FEA112A@xxxxxxxxxxxxxxxx
>> >> Hopefully someone will clarify an issue for me that has me baffled.
> This
>> > is
>> >> not the first time that selection of a range in another work***
>> > generates
>> >> errors. I want to select a range in another work***. Excel keeps
>> > giving
>> >> me a run time error '1004'.
>> >>
>> >> These errors occur even if I fully qualify the name, such as
>> >> Worksheets("PI").Range("P").Select. I also recorded a macro to see
> what
>> > it
>> >> generated for code, then copied that and still received the error.
>> >>
>> >> This is the code that I am using currently:
>> >>
>> >> Worksheets("PositionImports").Select
>> >> Range("Positions").Select
>> >>
>> >> This is the error with the Range select line highlighted in the IDE:
>> >>
>> >> Run time error '1004'
>> >>
>> >> Method 'Range' of object '_Work***' failed.
>> >>
>> >>
>> >> What gives here? Excel seems to not deal with this issue in a
> consistent
>> >> manner.
>> >>
>> >> Thank you,
>> >> Mark
>> >>
>> >
>> >
>>
>>
>
>


.