I need to create an if then "save as" function.
There are two saves we want:
1. Save As described below in the code - (this works fine)
2. When a revision is noted in worksheet("master appraisal").range (F75) than save save as the following:
We simple need help creating the conditional save based on ("F75")being blank or having the text "Revised Audit" present.
There are two saves we want:
1. Save As described below in the code - (this works fine)
2. When a revision is noted in worksheet("master appraisal").range (F75) than save save as the following:
Code:
ThisFile = "Visual Audit_" & " " & Range("B65").Text & " " & Replace(Range("B75").Text, "/", "-") & " " & Range("F75").Text
ActiveWorkbook.SaveAs Filename:=ThisFile
We simple need help creating the conditional save based on ("F75")being blank or having the text "Revised Audit" present.
Code:
Sub SaveAsNameDateScore()
If Trim(Range("B65")) = "" Then
MsgBox "Please enter Specialist Name"
Exit Sub
End If
If Not IsDate(Range("B74")) Then
MsgBox "Please enter Audit Completed Date"
Exit Sub
End If
If Not IsDate(Range("B75")) Then
MsgBox "Please enter Process Completed Date"
Exit Sub
End If
If Not IsNumeric(Range("C85")) Then
MsgBox "Please enter Average Quality Score"
Exit Sub
End If
If Range("C88") >= 0.95 And Range("C88") <= 1 Then
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Quality Seal").Select
ActiveSheet.Shapes("Picture 2").Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Master Appraisal").Select
Range("J1").Select
ActiveSheet.PasteSpecial Format:="Picture (JPEG)", Link:=False, _
DisplayAsIcon:=False
Selection.ShapeRange.ScaleWidth 0.93, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.93, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth 0.9, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.9, msoFalse, msoScaleFromTopLeft
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("B1").Select
End If
ThisFile = "Visual Audit_" & " " & Range("B65").Text & " " & Replace(Range("B75").Text, "/", "-") & " " & Range("C88").Text
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub