Re: Selecting
- From: "William Benson" <wbenson1(SPAMSUCKS)@nycap.rr.com>
- Date: Sun, 28 Aug 2005 21:13:03 -0400
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
>>
>
>
.
- Follow-Ups:
- Re: Selecting
- From: Tom Ogilvy
- Re: Selecting
- From: Rowan
- Re: Selecting
- References:
- Selecting
- From: Mark Petruszak
- Re: Selecting
- From: Tom Ogilvy
- Selecting
- Prev by Date: Re: inserting a work*** using visual basic
- Next by Date: Re: inserting a work*** using visual basic
- Previous by thread: Re: Selecting
- Next by thread: Re: Selecting
- Index(es):