First, let me state that I have zero VBA experience....
I am trying to create a macro that creates a new excel file and then performs some tasks and then saves the resultant file with a automatically generated and different file name. More specifics are as follows:
I have a excel spreadsheet and the columns have a bunch of payment details (who I have to pay and how much and for what). In the rows, I have a list of multiple companies and each company can have multiple rows (I owe them for multiple invoices). When I process the payment, I have to copy the payment details in the rows for each company into a new file so that I can send the details along witht he payment. (Note that I use the subtotal function in excel the break down each payment by supplier.)
I have created a simple macro that takes the initial file, lets call it the "Master", and copies all the details into a new file. In the new file, the macro deletes all rows, except those associated with the top supplier on the list, now I want to tell the macro to save this new file under the name of the supplier (lets call it cell G3). The macro then goes back to the master and deletes the rows associated with the supplier in the file that was just created and saved and then stops. (My plan is to then assign a shortcut key and keep pressing it until I have rerun the macro the total number of times that I need to in order to get each file that I need for each supplier).
My problem is that I do not know how to tell the macro to save the file with a different file name (i.e cell G3) each time that it is run.
Really could use some help on this one. Thanks in advance.
I am trying to create a macro that creates a new excel file and then performs some tasks and then saves the resultant file with a automatically generated and different file name. More specifics are as follows:
I have a excel spreadsheet and the columns have a bunch of payment details (who I have to pay and how much and for what). In the rows, I have a list of multiple companies and each company can have multiple rows (I owe them for multiple invoices). When I process the payment, I have to copy the payment details in the rows for each company into a new file so that I can send the details along witht he payment. (Note that I use the subtotal function in excel the break down each payment by supplier.)
I have created a simple macro that takes the initial file, lets call it the "Master", and copies all the details into a new file. In the new file, the macro deletes all rows, except those associated with the top supplier on the list, now I want to tell the macro to save this new file under the name of the supplier (lets call it cell G3). The macro then goes back to the master and deletes the rows associated with the supplier in the file that was just created and saved and then stops. (My plan is to then assign a shortcut key and keep pressing it until I have rerun the macro the total number of times that I need to in order to get each file that I need for each supplier).
My problem is that I do not know how to tell the macro to save the file with a different file name (i.e cell G3) each time that it is run.
Really could use some help on this one. Thanks in advance.