letting user select spreadsheet

Public Schedule Face-to-Face & Virtual Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Letting the User Select a spreadsheet to copy from | Excel forum

Letting the User Select a spreadsheet to copy from | Excel forum

resolvedResolved · Low Priority · Version 2007

Joe has attended:
Excel VBA Intro Intermediate course
Excel Advanced - For Power Users course

Letting the User Select a spreadsheet to copy from

Is there some simple code, where by a user is prompted to select a file where the data contained can be copied into the main file, and then close the file they chose, allowing them to retunr to the main document to work on the copied data?

RE: Letting the User Select a spreadsheet to copy from

Hi Joe, thanks for your query. There's no one line of code to do all that, as it involves several different procedures. First you need to capture the name of the file the user is interested in. Here's a useful walkthough of how to activate and gather information using the Excel dialog boxes.

http://www.ozgrid.com/VBA/ExcelsDialogBoxes.htm

Once you've got the filename, it's up to you how you want to code the rest. Perhaps code the opening of the file, the display of a userform with the Ref.Edit control allowing the user to select and OK a range of their choice, then the closure of that file, returning the user to the original file and allowing them to paste in the data. That's "all" there is to it!

Hope this helps,

Anthony

Mon 30 May 2011: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Edit and format multiple worksheets in one operation

To select two or more non-adjacent worksheets, click on the tab of each worksheet, while holding down the [CTRL] key.
To select two or more adjacent worksheets, click on the tab of the first worksheet and then on the tab of the last worksheet, while holding down the [SHIFT] key.
Enter or modify your data and apply the necessary formatting options to the sheet that's displayed

View all Excel hints and tips


Server loaded in 0.06 secs.