Reputation: 45
I would like to write an excel workbook name (the current one) in a cell using an excel macro.
I've tried to use
"=RIGHT(CELL(""filename"",R[-9]C[1]),LEN(CELL(""filename"",R[-9]C[1]))-SEARCH(""]"",CELL(""filename"",R[-9]C[1])))"
and it seems to be buggy, I would like to use the
ActiveWorkbook
method.
Upvotes: 1
Views: 908
Reputation: 49998
Simply write the ActiveWorbook.Name
to the cell, e.g.:
ActiveCell.Value = ActiveWorkbook.Name
Upvotes: 2