Re: problem referring to Range and Cells
From: Bob Phillips (bob.phillips_at_notheretiscali.co.uk)
Date: 02/28/04
- Next message: Rob van Gelder: "Re: SQL "INSERT INTO" puts Single Quote in Front of Text Value"
- Previous message: Bob Phillips: "Re: Nested IF absolute referencing macro"
- In reply to: Kevin: "Re: problem referring to Range and Cells"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 28 Feb 2004 01:05:50 -0000
That is correct, but an object can have a property, which is an object in
itself,. so you can have nested Withs , all referring to the top-level
object. This is what I used to circumvent the problem you had encountered
with
With Worksheets("Sheet2")
With .Range(.Cells(3, 1), .Cells(3, 5))
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"Kevin" <anonymous@discussions.microsoft.com> wrote in message
news:9809FD37-4DB2-4689-9BB6-E7350E43F1CC@microsoft.com...
> Thanks Bob and Tom. This is good to know. That is, when using the With
statement,
> qualify Worksheets and Ranges separately.
>
> I just now found the following in VB User Interface Help.
>
> Note Once a With block is entered, [the specific] object can't be
changed.
> As a result, you can't use a single With statement to affect a number
of
> different objects.
>
> Thanks again.
>
> Kevin
- Next message: Rob van Gelder: "Re: SQL "INSERT INTO" puts Single Quote in Front of Text Value"
- Previous message: Bob Phillips: "Re: Nested IF absolute referencing macro"
- In reply to: Kevin: "Re: problem referring to Range and Cells"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|