Hello! I posted the other day about a macro I was writing, where vendor invoice info is being copied into a report file. I want it to stop at the end of the range of cells being copied, and I'll get back to that, but for now, here are more questions:
I have the .xlsx file, which will have a different name every month. The macro is in the personal macro workbook. It goes to 5 specific cells, copies the data one cell at a time, to the report file, which is created by the macro, which also puts the headings in first and reformats them.
1) Since the file will have a different name every month - how can it be referred to in the code? I recorded the basic macro, and of course it picks up the name of the file I'm using when I switch back and forth during the copy/pastes.
2) The macro creates the new report file each time, and it is referred to as Window(Book 3). Will I not be able to have the macro create the file each time - or should I create the file I'm copying into first - and then what do I call that? The client will probably have to edit the code each month to have the correct file name - they'll hate that.
The question is, I guess, how to refer to file names in a more generic way so they can be re-used without the client having to edit the names?
Thanks in advance for helping a VBA Noo-B.
Diane
I have the .xlsx file, which will have a different name every month. The macro is in the personal macro workbook. It goes to 5 specific cells, copies the data one cell at a time, to the report file, which is created by the macro, which also puts the headings in first and reformats them.
1) Since the file will have a different name every month - how can it be referred to in the code? I recorded the basic macro, and of course it picks up the name of the file I'm using when I switch back and forth during the copy/pastes.
2) The macro creates the new report file each time, and it is referred to as Window(Book 3). Will I not be able to have the macro create the file each time - or should I create the file I'm copying into first - and then what do I call that? The client will probably have to edit the code each month to have the correct file name - they'll hate that.
The question is, I guess, how to refer to file names in a more generic way so they can be re-used without the client having to edit the names?
Thanks in advance for helping a VBA Noo-B.
Diane