Guest User

Untitled

a guest
Jul 24th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Excel 2003 template that saves the filename based on a cell value
  2. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
  3. Application.EnableEvents = False
  4. ThisWorkbook.SaveAs [B2] & "_" & Format(Date, "m-d-yy")
  5. Cancel = True
  6. Application.EnableEvents = True
  7. End Sub
  8.  
  9. ThisWorkbook.SaveAs ThisWorkbook.Worksheets("Sheet Name Here").Cells(2,2) ...
Advertisement
Add Comment
Please, Sign In to add comment