Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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) ...