The Private Sub is triggered by "Save As". "BEFORE SAVE" it converts specific formulas to values, on several tabs. This is needed for archiving data however is a problem when there are updates to the template requiring a new version number in the filename. I am not sure how to convert the code so it can only be run on purpose, by clicking a button. The file is too large to attach. Hopefully the code will suffice. Thank you in advance to anyone who responds!
>>> moved from Ask an Excel Question to VBA Macros <<<
>>> use code - tags <<<
>>> moved from Ask an Excel Question to VBA Macros <<<
>>> use code - tags <<<
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim I As Integer
Dim J As Integer
Dim Rng As Range
If SaveAsUI Then
Dim rs As Worksheet
For Each rs In Sheets
If rs.Name = "JOB list" Then
rs.Range("K2:L1001").Value = rs.Range("K2:L1001").Value
End If
If rs.Name = "EmpTbl" Then
rs.Range("A1:E8000").Value = rs.Range("A1:E8000").Value
rs.Range("G1:H8000").Value = rs.Range("G1:H8000").Value
rs.Range("L1:L8000").Value = rs.Range("L1:L8000").Value
End If
If rs.Name = "Outsourced PD" Then
rs.Range("A3:C298").Value = rs.Range("A3:C298").Value
End If
If rs.Name = "POV" Then
rs.Range("D1:E1001").Value = rs.Range("D1:E1001").Value
rs.Range("U1:U1001").Value = rs.Range("U1:U1001").Value
End If
Next rs
End If
End Sub
Attachments
Last edited by a moderator: