prompt for function arguments?

L

lecoughlin

I have a macro that calls a function with 2 arguments:
Import (file path, state)

This function is importing excel files into an access database. I
have to import a file for all 50 states. Is there a way to set
something up that when the code is run, it will prompt for the file
path and state?

Thanks in advance for any help.
 
W

wellend

Hi there

The best way might be to pop up a form first and get the user to select the
path and state. They could then click a button to call your function.

One great side benefit of this is that you could even have the user browse to
the file path, rather than having to enter it (which might be tricky if it's
a long path). There are various sample VBA code snippets around for browsing
to a file or path.

Good luck!

I have a macro that calls a function with 2 arguments:
Import (file path, state)

This function is importing excel files into an access database. I
have to import a file for all 50 states. Is there a way to set
something up that when the code is run, it will prompt for the file
path and state?

Thanks in advance for any help.

--
 

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