prompt for function arguments?

  • Thread starter Thread starter lecoughlin
  • Start date Start date
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.
 
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.

--
 
Back
Top