Hello again, could you someone give me a help with this?
I'm trying to create macro-code that when user selects commandbutton "save" on worksheet (that is linked to cell E2), msgbox will pop-up asking "save file as__E2-value__", "yes/no".
Save-button is linked to E2, where data changes daily and file is saved as data-name. One day cell E2-value can be "blaah", so file is saved as blaah, second day cell value can be "blaahblaah", so file is saved blaahblaah...etc.
Here's code I'm using;
´
For now, it does save the file, but when msgbox appears, filename doesn't appear on it.
I'm trying to create macro-code that when user selects commandbutton "save" on worksheet (that is linked to cell E2), msgbox will pop-up asking "save file as__E2-value__", "yes/no".
Save-button is linked to E2, where data changes daily and file is saved as data-name. One day cell E2-value can be "blaah", so file is saved as blaah, second day cell value can be "blaahblaah", so file is saved blaahblaah...etc.
Here's code I'm using;
Code:
Sub Save()
If MsgBox("Saves file as ", vbYesNo, "Save As") = vbYes Then
ActiveWorkbook.Save
Filename = Range("E2")
ActiveWorkbook.SaveAs Filename:=Filename
End If
End Sub
For now, it does save the file, but when msgbox appears, filename doesn't appear on it.