Excel to Access

G

Guest

Can you help me, I am trying to create a macro in acess that when activated
will automatically copy and paste data from an excel spreadsheet into an
access table.

The macro will look in a specific folder but the user should be able to
define the name of the particular file he/she wants to read from

Thanks

Nick
 
S

Steve Schapel

Nick,

Go to the macro design window for a new macro, enter TransferSpreadsheet
in the Action column, and press F1 to read the Help topic.

As regards the variable file name, one approach here would be to put an
unbound textbox on a form that will be open when the macro is executed.
The user will type the name of the file in here. Then, refer to this
textbox in the File Name argument of the TransferSpreadsheet action in
your macro, using syntax such as...
="C:\YourPath\" & [Forms]![NameOfYourForm]![TextboxName] & ".xls"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top