![]() |
running macros from LIST choices
I have a sheet that runs macros which open text files, manipulate the data,
and give me a clean, readable output. Works great, as long as I always have the same drive as the source. But I want to give the user an option to choose the drive from which to pull the data and where to put the report. Right now, I have Modules 1 thru 4, each performing a different function, all from the F: drive, based on the push of buttons 1 thru 4. What I would like to be able to do is select which report to run from a list, as well as which drive to pull from using another list, and somehow pass this info to a macro. The drive options I will need are A & C thru G. I COULD write a macro for each and every SUB, hard coding the drive info, but that will result in 28 SUBs, kinda messy & bulky. If it is possible to do what I am asking, I could pass two variables to 4 different SUBs, and open the data from whichever drive the user selects. Thanks in advance for your help! Dave |
running macros from LIST choices
You could drives in a dropdown, but the file would have to be in the same
spot on each. Will a dialog work for you? Application.Dialogs(xlDialogFindFile).Show They can select the drive and file -- -John Northwest11 Please rate when your question is answered to help us and others know what is helpful. "F6Hawk" wrote: I have a sheet that runs macros which open text files, manipulate the data, and give me a clean, readable output. Works great, as long as I always have the same drive as the source. But I want to give the user an option to choose the drive from which to pull the data and where to put the report. Right now, I have Modules 1 thru 4, each performing a different function, all from the F: drive, based on the push of buttons 1 thru 4. What I would like to be able to do is select which report to run from a list, as well as which drive to pull from using another list, and somehow pass this info to a macro. The drive options I will need are A & C thru G. I COULD write a macro for each and every SUB, hard coding the drive info, but that will result in 28 SUBs, kinda messy & bulky. If it is possible to do what I am asking, I could pass two variables to 4 different SUBs, and open the data from whichever drive the user selects. Thanks in advance for your help! Dave |
running macros from LIST choices
Yes, the files necessary will always have to reside in the same folder, that
is a given. Typically, the files will be on a USB stick (as the RAWDATA text files come from one computer system, then will be transported to a WinXP system for Excel manipulation), and that is why the need for variance in drives. I am not familiar with a dialog, I will look into this. Thanks for the reply! "John Bundy" wrote: You could drives in a dropdown, but the file would have to be in the same spot on each. Will a dialog work for you? Application.Dialogs(xlDialogFindFile).Show They can select the drive and file -- -John Northwest11 Please rate when your question is answered to help us and others know what is helpful. "F6Hawk" wrote: I have a sheet that runs macros which open text files, manipulate the data, and give me a clean, readable output. Works great, as long as I always have the same drive as the source. But I want to give the user an option to choose the drive from which to pull the data and where to put the report. Right now, I have Modules 1 thru 4, each performing a different function, all from the F: drive, based on the push of buttons 1 thru 4. What I would like to be able to do is select which report to run from a list, as well as which drive to pull from using another list, and somehow pass this info to a macro. The drive options I will need are A & C thru G. I COULD write a macro for each and every SUB, hard coding the drive info, but that will result in 28 SUBs, kinda messy & bulky. If it is possible to do what I am asking, I could pass two variables to 4 different SUBs, and open the data from whichever drive the user selects. Thanks in advance for your help! Dave |
All times are GMT +1. The time now is 08:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com