Hello,
I am new to the macro side of excel and have utilized the modules from an existing Mrexcel youtube video.
This is what i currently have and it works fine however i would like to add 2 more functions.
1. I would like to save the file as follows. yyyymmdd_("H5"),("G3"),("H3"). How do i add the date to the saved file?
2. I have assigned buttons for the macros in the worksheet. Is it possible that the saved file no longer shows these buttons.
Any other improvements that could be made would be greatly appreciated.
Thanks in advance and look forward to the feedback.
Shane
I am new to the macro side of excel and have utilized the modules from an existing Mrexcel youtube video.
This is what i currently have and it works fine however i would like to add 2 more functions.
VBA Code:
Sub NextDelnote()
Range("H5").Value = Range("H5").Value + 1
Range("A21:A50").ClearContents
Range("H3:I3").ClearContents
Range("H8:H9").ClearContents
Range("H21:H50").ClearContents
End Sub
Sub SaveDelWithNewName()
Dim NewFN As Variant
' Copy Delivery note to a new workbook
ActiveSheet.Copy
NewFN = "C:\Users\name\Documents\ " & Range("H5").Value & Range("G3").Value & Range("H3").Value & ".xlsx"
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:="c:\Users\name\Documents\" & Range("H5").Value & Range("G3").Value & Range("H3").Value & ".pdf"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextDelnote
End Sub
1. I would like to save the file as follows. yyyymmdd_("H5"),("G3"),("H3"). How do i add the date to the saved file?
2. I have assigned buttons for the macros in the worksheet. Is it possible that the saved file no longer shows these buttons.
Any other improvements that could be made would be greatly appreciated.
Thanks in advance and look forward to the feedback.
Shane