Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default retrieving data from variable workbooks

Hi,

I am trying to retrive data from variable workbooks based on the value of a
cell contained in the receiving workbook for example

Cell B1 contains the text "June"
I would like to return values from the workbook saved in C:\.....\june.xls
and extrapolating on that if I enter August in B1 I want to retrieve data
from C:\....\August.xls

Any help would be greatly appreciated

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default retrieving data from variable workbooks

Try this

Sub stance()
Path = "C:\" 'change to suit
fnam = Sheets("Sheet1").Range("B1").Value & ".xls"
Workbooks.Open Filename:=(Path & fnam)
End Sub

With (say) June in B1 this will open a workbook called June.xls in the root
of C

Mike

"lutan" wrote:

Hi,

I am trying to retrive data from variable workbooks based on the value of a
cell contained in the receiving workbook for example

Cell B1 contains the text "June"
I would like to return values from the workbook saved in C:\.....\june.xls
and extrapolating on that if I enter August in B1 I want to retrieve data
from C:\....\August.xls

Any help would be greatly appreciated

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default retrieving data from variable workbooks

Hi Mike,

Should I put this code into a module or into sheet 1 code, also will this
then allow me to update the receiving wokbook with data from the June
spreadsheet ie cell D6 in the main workbook needs to update with cell E17
from the June / August workbook

Thanks

Lutan


"Mike H" wrote:

Try this

Sub stance()
Path = "C:\" 'change to suit
fnam = Sheets("Sheet1").Range("B1").Value & ".xls"
Workbooks.Open Filename:=(Path & fnam)
End Sub

With (say) June in B1 this will open a workbook called June.xls in the root
of C

Mike

"lutan" wrote:

Hi,

I am trying to retrive data from variable workbooks based on the value of a
cell contained in the receiving workbook for example

Cell B1 contains the text "June"
I would like to return values from the workbook saved in C:\.....\june.xls
and extrapolating on that if I enter August in B1 I want to retrieve data
from C:\....\August.xls

Any help would be greatly appreciated

Thanks in advance

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default retrieving data from variable workbooks

Hi,

This now reads in the value from E17 in the June workbook and writes that to
D17 in the workbook from which the code is run. It will run as worksheet or
module code.


Sub standard()
Path = "C:\" 'change to suit
fnam = Sheets("Sheet1").Range("B1").Value & ".xls"
Workbooks.Open Filename:=(Path & fnam)
myValue = ActiveSheet.Range("E17").Value
ActiveWorkbook.Close savechanges = False
Sheets("Sheet1").Range("D17").Value = myValue
End Sub

"lutan" wrote:

Hi Mike,

Should I put this code into a module or into sheet 1 code, also will this
then allow me to update the receiving wokbook with data from the June
spreadsheet ie cell D6 in the main workbook needs to update with cell E17
from the June / August workbook

Thanks

Lutan


"Mike H" wrote:

Try this

Sub stance()
Path = "C:\" 'change to suit
fnam = Sheets("Sheet1").Range("B1").Value & ".xls"
Workbooks.Open Filename:=(Path & fnam)
End Sub

With (say) June in B1 this will open a workbook called June.xls in the root
of C

Mike

"lutan" wrote:

Hi,

I am trying to retrive data from variable workbooks based on the value of a
cell contained in the receiving workbook for example

Cell B1 contains the text "June"
I would like to return values from the workbook saved in C:\.....\june.xls
and extrapolating on that if I enter August in B1 I want to retrieve data
from C:\....\August.xls

Any help would be greatly appreciated

Thanks in advance

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
Retrieving Cell Data From Variable Files DJ Pomeroy Excel Worksheet Functions 3 April 24th 07 08:32 PM
Retrieving data from the web - help ! glynny Excel Worksheet Functions 0 February 20th 06 02:04 AM
Retrieving non adjacent data from other workbooks? Sue Excel Worksheet Functions 4 July 24th 05 11:18 AM
Combining workbooks with some variable field names Bob Dobalina Excel Discussion (Misc queries) 8 May 17th 05 09:48 PM
Variable Link to Workbooks dfrancefort Excel Worksheet Functions 1 April 28th 05 01:15 AM


All times are GMT +1. The time now is 08:06 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"