Gathering info from saved files

  • Thread starter Thread starter rxwillow
  • Start date Start date
R

rxwillow

Hey again,

I have another newbie question for you all.

Ok, so there is an excel spreadsheet that one part of my office save
daily with personal information such as company name, address, taxes
proceeds and whatnot. Lets say the name of the file is always:

"recon 1 18 04" (the current date at the end)

There are workbooks that I use daily that are different for ever
company that we work with. So I usually have to open my workbook, dum
the recon spreadsheet into its own sheet in my workbook, take th
information pertaining to the company that im currently working on an
use that info to populate fields in my workbook.

I would like to add a button to my toolbar that would grab the reco
file from where it is always saved (lets just say C:/reports/ ..) dum
the information into my workbook as its own sheet and take the inf
with the companys name that im working on and populate the field
corresponding to that information.

I hope I was descriptive enough.

Thanks
 
Hi

The following should get you going. It assumes that you are starting in the file that you want to import the sheet into. It will request the name of the sheet (excl the recon constant). This could be changed to be based on the current date if so required. It will transfer the sheet (called recon as you did not detail) into the current sheet. As recon is the only sheet in the workbook, it will automatically close without saving.

You have not given any detail on what info you want where, so that aspect has not been covered.

To make this associated with a button, put the code into its own workbook, save the workbook, then save again as an xla file (addin). Go to tools, addins, browse to find the file and include. Make sure that it is selected. You can then create an icon on the toolbar, and associate it with the macro in the addin.

Tony

ChDir "c:\reports"
curfile = ActiveWorkbook.Name
recfile = InputBox("Enter date of file", , "1 14 04")
Workbooks.Open FileName:="recon " & recfile
Sheets("recon").Move After:=Workbooks(curfile).Sheets(1)

----- rxwillow > wrote: -----

Hey again,

I have another newbie question for you all.

Ok, so there is an excel spreadsheet that one part of my office saves
daily with personal information such as company name, address, taxes,
proceeds and whatnot. Lets say the name of the file is always:

"recon 1 18 04" (the current date at the end)

There are workbooks that I use daily that are different for every
company that we work with. So I usually have to open my workbook, dump
the recon spreadsheet into its own sheet in my workbook, take the
information pertaining to the company that im currently working on and
use that info to populate fields in my workbook.

I would like to add a button to my toolbar that would grab the recon
file from where it is always saved (lets just say C:/reports/ ..) dump
the information into my workbook as its own sheet and take the info
with the companys name that im working on and populate the fields
corresponding to that information.

I hope I was descriptive enough.

Thanks.
 
Back
Top