Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Retrieving Cell Data From Variable Files | Excel Worksheet Functions | |||
Retrieving data from the web - help ! | Excel Worksheet Functions | |||
Retrieving non adjacent data from other workbooks? | Excel Worksheet Functions | |||
Combining workbooks with some variable field names | Excel Discussion (Misc queries) | |||
Variable Link to Workbooks | Excel Worksheet Functions |