John has attended:
Excel Advanced course
Using cell names to save a document via macro
I wanted to know how I create a macro where I can use 2 (or more) cells to name the excel workbook, using a Macro.
I.e. At work I am required to save a document for each supplier; and the file must ideally be saved as follows:
"supplier name_Date of Workbook_Division"
However, this information would already be entered in the workbook.
Thanks
RE: Using cell names to save a document via macro
Hi John, thanks for your query. That will be tricky to pull off using macros alone; you're going to need some code to do it. You'll need to concatenate the values in the cells together, remembering to add the appropriate ".xls" file extension. Then use
Activeworkbook.saveas filename:= Sheets("MySheet").Range("c1").value
...changing the locations to fit.
Hope this helps,
Anthony
RE: Using cell names to save a document via macro
Hi Anthony,
My apologies; yes I realised that it will require code and not Macro alone.
I'm not sure what you mean by adding the appropriate '.xls' file extension. The workbook would save in Macro-enable workbook anyway, would it not?
Is there a chance I could send the workbook to you? As I have genuinely tried working this out for some time using my own code[s], and have not got very far with it.
Thanks,
John.