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

Creating charts from user defined files

Status
Not open for further replies.

beakerboy

Technical User
May 31, 2001
27
US
I have a directory containing several Excel Workbooks. I'd like to create a new workbook which extracts data from the other sheets and displays the data on charts.

My example:
File Master.xls contaions cells A1 and B1 which contain the phrases "Book1" and "Book2" respectively. After a button is pressed, or as the text is entered, the chart page named volume will plot Book1.xls!Volume vs Book1.xls!Hour and Book2.xls!Volume vs Book2.xls!Hour.

To start out, What is the VBA function to store the contents of range Book1.xls!Volume into memory?

Thanks for any help.
Kevin Nowaczyk


 

myvalue = activeworkbook.cells(1,1).value

Gives A1 - for B1, use cells(1,2)

// Patrik
______________________________

To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the IT Professional, the glass is twice as big as it needs to be.
 

myvalue = activeworkbook.cells(1,1).value
that's A1

myvalue = activeworkbook.cells(1,2).value
Thats B1

// Patrik
______________________________

To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the IT Professional, the glass is twice as big as it needs to be.
 
That's not really what I asked. The poin of this question is to bypass the use of cell references and use the named ranges from the second workbook. Again:

What is the VBA function to store the contents of range Book1.xls!Volume into memory?
 
What does the data look like?
What you probably want to do is create a new worksheet with all of the data you want to chart and make a chart of that. Doing that implies that there is a consistent format for all of the files you want to use as a source.
To copy a range of data to a new location, look up copy in the VBA help file. That will show you the correct syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top