View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Array difference?

The first is creating an array of strings, the second is creating a sheets
object using an array of strings to define the sheets. So the latter will be
an object of 3 sheets.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steph" wrote in message
...
Hi. Was hoping someone could clarify something for me. What is the
difference between the following:

Dim arr1()
arr1 = Array("Sheet1", "Sheet2", "Sheet3")

Dim arr2 As Sheets
Set arr2 = Sheets(Array("Sheet1", "Sheet2", "Sheet3"))

I've been reading the message boards a lot lately, and have seen bopth
methods being used for creating arrays. I think one is set up as a
variable, but not sure. Anyway, they apparently differ in their use of
syntax, becasue I have tried meshing both styles into my code, and one

style
works while the other does not.

Just a general clarification would be greatly appreciated, or even better

a
link to a site that describes in detail the difference? Thanks a bunch!