Hi,
I have a macro that works wonderfully and I wanted to modify it to do something else. I am having trouble with the modification and I wanted some insight on whether I should continue on the path I am on or start with something new.
I currently have (for my coworkers ease of use) a macro enabled workbook with a one click button. After the click the macro does the following:
Macro enabled workbook -> New workbook is created and input box asks user to select text file (CSV). Text file is opened and data is processed -> Processed data is copied to the new workbook -> CSV file is closed and Macro enabled workbook is closed.
For my new project I want to be able to open CSV file 1 and process the data, then open CSV file 2 and process its data, then marry CSV1 and CSV2 data together on the new workbook.
I have the macro worked out on the marrying of CSV1 and CSV2 data. My trouble is I get terribly confused switching between workbooks and worksheets in macros and I'm not sure what is the best approach. It would be easier in my mind to copy the data from CSV1 and CSV2 to the new workbook and process it there. I'm having trouble with that because the worksheet names will never be the same in CSV1 and CSV2.
It seems most of my trouble is dealing with the names in VBA but also asking for a second CSV to be opened and processed.
I thought twice about posting, I realize I'm not asking an easy or direct question. I just wanted some insight on what might be the best approach.
Thanks in advance for any ideas.
I have a macro that works wonderfully and I wanted to modify it to do something else. I am having trouble with the modification and I wanted some insight on whether I should continue on the path I am on or start with something new.
I currently have (for my coworkers ease of use) a macro enabled workbook with a one click button. After the click the macro does the following:
Macro enabled workbook -> New workbook is created and input box asks user to select text file (CSV). Text file is opened and data is processed -> Processed data is copied to the new workbook -> CSV file is closed and Macro enabled workbook is closed.
For my new project I want to be able to open CSV file 1 and process the data, then open CSV file 2 and process its data, then marry CSV1 and CSV2 data together on the new workbook.
I have the macro worked out on the marrying of CSV1 and CSV2 data. My trouble is I get terribly confused switching between workbooks and worksheets in macros and I'm not sure what is the best approach. It would be easier in my mind to copy the data from CSV1 and CSV2 to the new workbook and process it there. I'm having trouble with that because the worksheet names will never be the same in CSV1 and CSV2.
It seems most of my trouble is dealing with the names in VBA but also asking for a second CSV to be opened and processed.
I thought twice about posting, I realize I'm not asking an easy or direct question. I just wanted some insight on what might be the best approach.
Thanks in advance for any ideas.