I am trying to create essentially a delivery docket template, I have it all setup and currently you need to look in the folder to see what the next number sequence is the it automatically saves with the number you have put in and then in the suppliers folder or creates a new folder (information gained from this website)
But what I would really like to do it when you open the template workbook it grabs the next number sequence maybe from another source file and then when you hit the save button it then saves the file (which is currently working) and exports the delivery docket number the supplier name and then possibly the first line of the items being sent to the file that has the number system in it so then possibly later down the track I can look up data by the delivery docket number.
Currently this is the code I am up to for the saving but I want to add automated sequential numbering system, the file saves in the supplier folder with the name of the delivery docket number and then the description from line one.
Any help would be amazing please
Option Explicit
Const MYPATH As String = "F:\Data\2584\08 General\20 Warehouse\7.Outward Deliveries\Delivery Dockets\"
Sub IfNewFolder()
Dim part3 As String
part3 = Range("D3").Value
If Len(Dir(MYPATH & part3, vbDirectory)) = 0 Then
MkDir MYPATH & part3
End If
End Sub
Sub SaveCustomizedCourse()
Dim part1 As String
Dim part3 As String
Dim part4 As String
part1 = Range("O2").Value <delivery docket number>
part3 = Range("D3").Value <supplier name>
part4 = Range("G10").Value <line one of the item description>
IfNewFolder
ActiveWorkbook.SaveAs Filename:= _
MYPATH & part3 & "\" & part1 & " - " & part4 & ".xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
But what I would really like to do it when you open the template workbook it grabs the next number sequence maybe from another source file and then when you hit the save button it then saves the file (which is currently working) and exports the delivery docket number the supplier name and then possibly the first line of the items being sent to the file that has the number system in it so then possibly later down the track I can look up data by the delivery docket number.
Currently this is the code I am up to for the saving but I want to add automated sequential numbering system, the file saves in the supplier folder with the name of the delivery docket number and then the description from line one.
Any help would be amazing please
Option Explicit
Const MYPATH As String = "F:\Data\2584\08 General\20 Warehouse\7.Outward Deliveries\Delivery Dockets\"
Sub IfNewFolder()
Dim part3 As String
part3 = Range("D3").Value
If Len(Dir(MYPATH & part3, vbDirectory)) = 0 Then
MkDir MYPATH & part3
End If
End Sub
Sub SaveCustomizedCourse()
Dim part1 As String
Dim part3 As String
Dim part4 As String
part1 = Range("O2").Value <delivery docket number>
part3 = Range("D3").Value <supplier name>
part4 = Range("G10").Value <line one of the item description>
IfNewFolder
ActiveWorkbook.SaveAs Filename:= _
MYPATH & part3 & "\" & part1 & " - " & part4 & ".xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub