Good Morning,
First time post
Very new to Macros especially writing anything so if the below is of a 6 yo level I apologise.
I'm using a Button within an Excel Workbook to save the current workbook, its location is within a user's cloud desktop, the code below works If I use a known users thread but not when I use %USERSPROFILE%
Can you show me where I'm going wrong, I have to warn you I'm only hours into my coding experience and some of the posts I've tried to understand are a little over my head.
Code as below
Thanks
First time post
Very new to Macros especially writing anything so if the below is of a 6 yo level I apologise.
I'm using a Button within an Excel Workbook to save the current workbook, its location is within a user's cloud desktop, the code below works If I use a known users thread but not when I use %USERSPROFILE%
Can you show me where I'm going wrong, I have to warn you I'm only hours into my coding experience and some of the posts I've tried to understand are a little over my head.
Code as below
VBA Code:
Sub Save_Cert()
Dim Path As String
Dim FileName1 As String
user = Environ("userProfile")
Path = "user" & "\OneDrive - Teddy Bear Group Ltd\MM Test Certificates"
FileName1 = Range("AD2")
ThisWorkbook.SaveAs Filename:=Path & FileName1, FileFormat:=52
End Sub
Thanks