Excel to Access

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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"
 
Back
Top