Fellow Forum Members,
Below is a link to an Excel 2007 sample layout I have uploaded to describe a task that requires a Macro to be capable of detecting what cell is currently selected. Is such a thing possible with a Macro? If the answer is yes, then please read on below where I describe the task I want to accomplish in more detail:
http://www.box.net/shared/9ikmx3j2b4
I would be very grateful if anyone out there could help me develop a macro that matches one of five templates to a list of names I have listed in “Column A”. The template are text files that reside in C:\Templates folder and are for simplicity sake are named:
•1one.txt
•2two.txt
•3three.txt
•4four.txt
•5five.txt
My names are listed in cells A1 through A26 and for simplicity sake the names are as follow:
•Cell A1 = Document1
•Cell A2 = Document2
•Cell A3 = Document3
•Etc….
My goal is to have an individual button coded to target each of the five template text files which I need to manually match to the correct Document name. The buttons I'm seeking to setup are named:
•1one
•2two
•3three
•4four
•5five
The macro can detect which cell in Column A is currently selected. So if I want to match template "1one.txt" to the name “Document3”, all I have to do is select Cell A3 ("Document3") and click the button that is assigned to template “1one.txt” which is button “1one”. Once I manually make this match and hit the "1one" button, the macro copies the file “1one.txt” (located in C:\Templates), and then renames the matched template file with the name “Document3.txt” and then it pastes the “Document3.txt” file in a folder located in C:\Output. Also, the macro also makes a list of the matched / processed files in "Column H"
Attached is an Excel file that shows a descriptive layout to provide further clarification. Essentially, I'm seeking to manually match custom names to specific external text files with the help of buttons.
I'm just seeking for the basic code for only one button. It is not necessary to code all five buttons. Any help will be greatly appreciated.
Below is a link to an Excel 2007 sample layout I have uploaded to describe a task that requires a Macro to be capable of detecting what cell is currently selected. Is such a thing possible with a Macro? If the answer is yes, then please read on below where I describe the task I want to accomplish in more detail:
http://www.box.net/shared/9ikmx3j2b4
I would be very grateful if anyone out there could help me develop a macro that matches one of five templates to a list of names I have listed in “Column A”. The template are text files that reside in C:\Templates folder and are for simplicity sake are named:
•1one.txt
•2two.txt
•3three.txt
•4four.txt
•5five.txt
My names are listed in cells A1 through A26 and for simplicity sake the names are as follow:
•Cell A1 = Document1
•Cell A2 = Document2
•Cell A3 = Document3
•Etc….
My goal is to have an individual button coded to target each of the five template text files which I need to manually match to the correct Document name. The buttons I'm seeking to setup are named:
•1one
•2two
•3three
•4four
•5five
The macro can detect which cell in Column A is currently selected. So if I want to match template "1one.txt" to the name “Document3”, all I have to do is select Cell A3 ("Document3") and click the button that is assigned to template “1one.txt” which is button “1one”. Once I manually make this match and hit the "1one" button, the macro copies the file “1one.txt” (located in C:\Templates), and then renames the matched template file with the name “Document3.txt” and then it pastes the “Document3.txt” file in a folder located in C:\Output. Also, the macro also makes a list of the matched / processed files in "Column H"
Attached is an Excel file that shows a descriptive layout to provide further clarification. Essentially, I'm seeking to manually match custom names to specific external text files with the help of buttons.
I'm just seeking for the basic code for only one button. It is not necessary to code all five buttons. Any help will be greatly appreciated.