Guest User

Untitled

a guest
Dec 11th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Private Sub Workbook_Open()
  2. Dim lastRow As Long 'last row with data
  3. Dim thisDate As Double 'start timestamp
  4. thisDate = Now()
  5. With Sheets("Pressure Log")
  6. lastRow = .Range("B" & .Rows.Count).End(xlUp).Row 'populate next row with date/time
  7. .Range("B" & lastRow + 1 & ":G" & lastRow + 1).Borders.LineStyle = xlContinuous
  8. .Range("B" & lastRow).Offset(1) = Format(thisDate, "dddd")
  9. .Range("B" & lastRow).Offset(1, 1) = Format(thisDate, "mm/dd/yyyy")
  10. .Range("B" & lastRow).Offset(1, 2) = Format(thisDate, "hh:mm AM/PM")
  11. .Range("B" & lastRow).Offset(1, 3).Select 'position for data
  12. End With
  13. End Sub
Add Comment
Please, Sign In to add comment