Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro with variable field?

Status
Not open for further replies.

skygirl65

Technical User
Jul 18, 2004
32
US
I need to record a Macro in Excel that will stop and prompt me for the file name to open. I am not good with VBA, but I can record simple macros. (can't edit them after they are done) Can this be done?
 
Hi skygirl,

For future reference, please ask VBA questions in the VBA Forum.

Secondly a bit more information would be helpful but I presume you have recorded a macro which opens a file and wish to change it to prompt for the name. Try changing the line which begins ..

[blue][tt] Workbooks.Open ....[/tt][/blue]

to

[blue][tt] Application.Dialogs(xlDialogOpen).Show[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Thanks for the reply... unfortunately I do not know how to edit a macro once it is created. Can I record one with a pause or place to enter the file name?

I'd like to be better with VBA, but it is Greek to me. I can't make heads or tales of any of it. I wouldn't have the first idea how to make the changes you are recommending. Is there a good VERY BASIC beginners resource where I might learn?
 


alt+F11 toggles between the VB Editor and the active sheet.

Skip,
[sub]
[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top