Hello,
I am trying to create a folder in the existing (same as current workbook) directory. I want this folder to be named according to a cell reference. I am then trying to save the workbook to the directory. When saving, I want the filename to be based off cell references as well. Currently, this code will simply save the file to the current directory and also create a folder. But it won't save the file to the folder.
Any help is appreciated. I know this should be fairly simple in VBA, but I'm a total newbie. I believe the issue to be related to the .SaveAs portion in the bottom.
I am trying to create a folder in the existing (same as current workbook) directory. I want this folder to be named according to a cell reference. I am then trying to save the workbook to the directory. When saving, I want the filename to be based off cell references as well. Currently, this code will simply save the file to the current directory and also create a folder. But it won't save the file to the folder.
Any help is appreciated. I know this should be fairly simple in VBA, but I'm a total newbie. I believe the issue to be related to the .SaveAs portion in the bottom.
VBA Code:
Sub save()
Dim Path As String
Dim filename As String
Dim filename2 As String
Dim filename3 As String
Dim filename4 As String
Dim fullname As String
Dim fldr As String
fldr = Range("C5")
MkDir ("U:\Personal Folders\Current\DMee\! Costs Sheets\fldr")
Path = "U:\Personal Folders\Current\DMee\! Costs Sheets\fldr"
filename = Range("C9") & "__"
filename2 = Range("C4") & "__"
filename3 = Range("C6") & "ft release" & "__"
filename4 = Range("C5")
fullname = filename + filename2 + filename3 + filename4
ActiveWorkbook.SaveAs filename:=Path & fullname, FileFormat:=xlNormal
End Sub