Declaring Worksheets
I would include the workbook object
With ActiveWorkbook
Set wsQty = .Worksheets(1)
Set wsSales = .Worksheets(2)
Set wsfinal = .Worksheets(3)
End With
--
---
HTH
Bob
(change the xxxx to gmail if mailing direct)
"RSteph" wrote in message
...
I have an excel workbook with 3 worksheets in it. I'm looking to do some
formatting to the first two pages, and then pull some information from
each
of them to the third page, to create a final report.
for ease of navigation between each page in the code, I'm made 3 variables
of type worksheet, one to hold each sheet. I've opened external sheets
before, from other workbooks, but never within the same workbook, so I
wanted
to double check that I'm doing this right.
Can I simply instantiate my variables like this?:
Set wsQty = Worksheets(1)
Set wsSales = Worksheets(2)
Set wsfinal = Worksheets(3)
Assuming that the first page in the quantities, 2nd is sales, and 3rd page
is where the final report will go.
|