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

Excel 2013 - Open workbook, copy worksheet into another workbook VBA

Status
Not open for further replies.

pendle666

Technical User
Jan 30, 2003
295
GB
Hello

I can't believe this is causing me to much bother! I have a template workbook shakeout.xltm - what I want to do when running my macro is:

on click: open file dialog box which is at P:\data\misc

It to pause while I pick the xlsx file I want to use (there will be new files each month, so I can't hard code the filename)

When I've picked it, the file opens and then copies from the newly opened file to the shakeout.xltm workbook.

Then I'll repeat this so the next file is opened and copied.

I've been looking for examples to get me started, but I'm only getting quite old results which are giving errors.

I've got as far as the dialog box opening up, but it won't go to where I want it to.

[pre]ChDir "P:\data\misc"

workbookName = Application.GetOpenFilename("Excel Files (*.xls*), *.xls*")[/pre]

Someone please put me out of my misery!

thank you for helping

____________
Pendle
 
Since this is a VBA question, you may have a better chance of getting the answer to your issue in forum707


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top