Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting/Formatting from Access to Excel

Status
Not open for further replies.

RoseV

Programmer
Mar 18, 2003
37
US
If you scroll thru a recordset in a procedure, sending the same query with different criteria to the same path, Microsoft automatically creates mulitple worksheets within a single workbook. In order to format these individually, I need to run thru the format routine, and then move to the next worksheet...what command can I use to do this? wks.activesheet...?
 
As always, I figured it out as soon as I wrote the post.
In case this helps anyone:

Dim objASht As Worksheet
Dim wks As Workbook
Dim Path As String
Dim WksCt As Integer

'This is in a loop until all worksheets have been formatted

Path = "..."
WksCt = 1
Set wks = GetObject(Path)
Set objASht = wks.Worksheets(WksCt)
Set objASht = wks.ActiveSheet

Do While...

'DO FORMATTING

WksCt = WksCt + 1
Set objASht = wks.Worksheets(WksCt)
Set objASht = wks.ActiveSheet

Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top