I am creating a work order template that I would like to automatically assign a work order number when a new one is opened. Is there a way to have this read another file to select consective numbers each time the template is used to open a new file?
Sub GetOrdernumber()
Dim FN As String
Dim Ordernumber As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Workbooks.Open Filename:="S:\My FOlder\Book1.xls"
FN = ActiveWorkbook.Name
Ordernumber = Range("B65536").End(xlUp).Offset(1, -1).Value
Range("B65536").End(xlUp).Offset(1, 0) = "Used"
ActiveWorkbook.Save
ActiveWindow.Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Application.EnableEvents = True
MsgBox Ordernumber
End Sub