View Single Post
  #1   Report Post  
bob_mhc
 
Posts: n/a
Default Accessing Excel pages using VB

Hi. I'm wondering if any of you can help me with a problem I'm having. It's
likely a trivial answer, but I'm not seeing it at the moment.

I'm using VB 6.0 and Excel 2002.

I have an Excel workbook that has information about days of the month --
each day having an individual spreadsheet 'Day (1)', 'Day (2)', etc. as tabs
along the bottom of the workbook. I want to be able to access information
from individual "days" using a VB application and do some processing and then
printing of the data in VB.

First of all, when addressing data on spreadsheet Day(k) of the workbook,
how do I do that. For instance, using

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet as Excel.Worksheet
Dim row As Integer

Then later on I may use:

txtAmount.Text = xlSheet.Cells(row, 5).Value

but I need some way to identify 'Day (16)' as the worksheet that I'm
actually working on in this line. And, I want to have the "16" as something
I enter in a textbox at runtime to identify the day that I want to work on.
Then another time, I would use 'Day (9)', and so forth.

Can anyone help me on those things?

Many thanks,
Bob