jondavis1987
Active Member
- Joined
- Dec 31, 2015
- Messages
- 443
- Office Version
- 2019
- Platform
- Windows
So if I run this when it's the only workbook open it will save the changes and close that workbook. But the personal macro workbook will now be showing. I'd like it where if I execute this macro it will save the workbook and close out of it and the personal macro book if the active workbook is the only one open. Having just done it again I realize it's not the personal macro book. It's just a blank excel thing waiting for me to either close it or open a new workbook. I would still like this closed if possible when the active workbook is the only workbook open
VBA Code:
Sub Log_Changes()
Dim lastRow As Long
lastRow = Sheets("Superpave Template").Cells(Rows.Count, "B").End(xlUp).Row + 1
Range("B" & lastRow).NumberFormat = "mm/dd/yyyy"
Range("C" & lastRow).NumberFormat = "0%"
Range("D" & lastRow).NumberFormat = "0%"
Range("E" & lastRow).NumberFormat = "0%"
Range("F" & lastRow).NumberFormat = "0%"
Range("G" & lastRow).NumberFormat = "0%"
Range("H" & lastRow).NumberFormat = "0%"
ActiveSheet.Range("B39").Copy
ActiveSheet.Range("B" & lastRow).PasteSpecial xlPasteValues
ActiveSheet.Range("C5:H5").Copy
ActiveSheet.Range("C" & lastRow).PasteSpecial xlPasteValues
ActiveWorkbook.Close SaveChanges:=True
End Sub