Hello all,
I have done much digging in order to get this far but I'm still in little bit of a pickle. I am trying to make it so if a cell I have has a specific number form that it will save to a specific folder. In the Cell (L1) I have the date set as "mm-dd-yyyy hh-mm" and machine number ("11D, 12D, 13D"). When I save the file it looks like this "8-9-2021 9-38 11D", which is perfect. However I am trying to find a way to direct the file depending on the machine (11D, 12D, 13D) into their own separate folders. This is the VBA I am using through a button click at the moment. Ignore the path, I'm just using it for testing purposes. Any suggestions or help is much appreciated. Thank you in advance.
Private Sub CommandButton1_Click()
Dim path As String
Dim filename1 As String
path = "\\DESKTOP-9IK993S\2TB Download Drive\Torrents\"
filename1 = Range("L1").Text
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs filename:=path & filename1 & ".xlsx", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
Application.Quit
End Sub
I have done much digging in order to get this far but I'm still in little bit of a pickle. I am trying to make it so if a cell I have has a specific number form that it will save to a specific folder. In the Cell (L1) I have the date set as "mm-dd-yyyy hh-mm" and machine number ("11D, 12D, 13D"). When I save the file it looks like this "8-9-2021 9-38 11D", which is perfect. However I am trying to find a way to direct the file depending on the machine (11D, 12D, 13D) into their own separate folders. This is the VBA I am using through a button click at the moment. Ignore the path, I'm just using it for testing purposes. Any suggestions or help is much appreciated. Thank you in advance.
Private Sub CommandButton1_Click()
Dim path As String
Dim filename1 As String
path = "\\DESKTOP-9IK993S\2TB Download Drive\Torrents\"
filename1 = Range("L1").Text
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs filename:=path & filename1 & ".xlsx", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
Application.Quit
End Sub