Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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

  #2   Report Post  
Mangus Pyke
 
Posts: n/a
Default

On Sat, 16 Jul 2005 14:03:01 -0700, "bob_mhc"
wrote:
First of all, when addressing data on spreadsheet Day(k) of the workbook,
how do I do that. For instance, using


Workbooks("Filename.xls").Sheets("Day(k)").Range(" A1 or
whatever").Value

If you always have the days in the same order, you can also use:
Workbooks("Filename.xls").Sheets.Item(*index_numbe r*).Value..

In other words, if your second worksheet is Day (2), then you could
address it by calling:
Workbooks("Filename.xls").Sheets.Item(2)

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.


So call an InputBox and set the response to a variable, such as TabDay
and then call your worksheets using:
Workbooks("Filename.xls").Sheets.Item(TabDay)

Can anyone help me on those things?


Was that helpful or more confusing?

MP-

--
"Learning is a behavior that results from consequences."
B.F. Skinner
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
How do you format a row to break accross pages in Excel? DD Excel Worksheet Functions 4 May 4th 05 09:34 PM
how do i find percentage from 2 different pages in Excel? fpbuckland Excel Worksheet Functions 1 January 6th 05 02:07 AM
Problem accessing Oracle Public Synonyms from Microsoft Excel 2002 Sandeep Excel Discussion (Misc queries) 1 January 5th 05 09:31 AM
How do I remove pages in Excel? Carrmela Excel Discussion (Misc queries) 1 December 9th 04 08:13 PM


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"