Andreas Hermle
asked on
Add a file extension to the cells of the current column using an input prompt
Dear Experts:
I would like to perform the following action on all the cells of the current column (one cell is activated in the current column)
1. Prompt the user to enter a file extension in an inputbox (only characters are allowed, no numbers)
2. Add this extension to all the values in the current column
For example: User enters '.pdf' in the inputbox
Current Column Current Column after running the macro
MyFirst_File MyFirst_File.pdf
MySecondFile MySecondFile.pdf
MyThirdFile MyThirdFile.pdf
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
I would like to perform the following action on all the cells of the current column (one cell is activated in the current column)
1. Prompt the user to enter a file extension in an inputbox (only characters are allowed, no numbers)
2. Add this extension to all the values in the current column
For example: User enters '.pdf' in the inputbox
Current Column Current Column after running the macro
MyFirst_File MyFirst_File.pdf
MySecondFile MySecondFile.pdf
MyThirdFile MyThirdFile.pdf
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
ASKER
Hi Macro Shadow,
thank you very much for your highly sophisticated code. I am really impressed. I guess we are almost there. I am afraid to tell you that there is one small bug in the code:
If the user presses Cancel, i.e. does not fill in anything in the InputBox, a trailing dot still gets added to the cell values. As a matter of fact nothing should be added in that case.
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
thank you very much for your highly sophisticated code. I am really impressed. I guess we are almost there. I am afraid to tell you that there is one small bug in the code:
If the user presses Cancel, i.e. does not fill in anything in the InputBox, a trailing dot still gets added to the cell values. As a matter of fact nothing should be added in that case.
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi MacroShadow,
great this did the trick. Thank you very much for your great and professional help.
I tweaked it just a little bit, line 10: '=' instead of '<>'
Regards, Andreas
great this did the trick. Thank you very much for your great and professional help.
I tweaked it just a little bit, line 10: '=' instead of '<>'
Regards, Andreas
My bad.
Open in new window