josullivan601632
New Member
- Joined
- Aug 23, 2020
- Messages
- 23
- Office Version
-
- 2007
- Platform
-
- Windows
Hi I have a macro (using a button) for save as, (using the value of a cell + date), that works great, however all of a sudden it has stopped saving in the current directory/folder and is going in my local disk and I don't know how to fix it 
This is what I have:
Sub Macro1()
'
' Macro1 Macro
'
Dim fname As String
fname = Range("B2") & Format(Now(), " DD.MM.YY") & ".xlsm"
MsgBox fname
ActiveWorkbook.SaveAs Filename:=fname
End Sub
I know I could specify the filepath but don't know how to write that code AND have " Range("B2") & Format(Now(), " DD.MM.YY") & ".xlsm "
Any help would be greatly appreciated!
This is what I have:
Sub Macro1()
'
' Macro1 Macro
'
Dim fname As String
fname = Range("B2") & Format(Now(), " DD.MM.YY") & ".xlsm"
MsgBox fname
ActiveWorkbook.SaveAs Filename:=fname
End Sub
I know I could specify the filepath but don't know how to write that code AND have " Range("B2") & Format(Now(), " DD.MM.YY") & ".xlsm "
Any help would be greatly appreciated!