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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Multiple sheets in Excel

Status
Not open for further replies.

mharcourt

Programmer
Apr 9, 2003
49
0
0
US
I need a little help in accessing different sheets in Excel.
I have scripts to open and retrieve cell contexts located on the first sheet. How do I move to the next sheet?
 
Hi
Code:
set wbk = [i]you Excel workbook object[/i]
for each ws in wbk.worksheets
  with ws
    'do stuff to worksheet, [b]ws[/b] as the object reference
     .Cells(1, 1).Value = "Hello"  'put Hello in A1 in sheet ws
  end with
next


Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
Thanks
You'll have to hold my hand on this one.
What I have so far is :
Set objXL = WScript.CreateObject("Excel.Application")
objXL.Visible = FALSE
objXL.Workbooks.Open(<path to xls file>)

Where does "set wbk = you Excel workbook object" fit in?


 
Code:
set wbk = objXL.Workbooks.Open(<path to xls file>)

Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
:)

Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top