DavyJones90
Board Regular
- Joined
- Feb 23, 2022
- Messages
- 62
- Office Version
- 365
- Platform
- Windows
Hello I have a Macro which automatically creates a PDF of an Analysis sheet, now the problem I am facing is that I want to build in a check step to ensure the full analysis was completed fully,
So my idea is something like this
Thanks in advance!
So my idea is something like this
VBA Code:
'(FAKE CODE)
IF a cell in Range("N4:N14") <> 0 OR "" check the the same Row in Column("I") and ensure that it's value is more than 0 OR "" Then
MsgBox "PDF Could not be created because a Value in Coloumn I is missing "
Else
ThisWorkbook.Worksheets("AUTO ENTRY POINTS").Range("O4").NumberFormat = "dd/mm/yy"
ThisWorkbook.Worksheets("AUTO ENTRY POINTS").Range("O4").Value = Date
ThisWorkbook.Worksheets("AUTO ENTRY POINTS").Cells.Copy
newWorkbook.Worksheets(1).Cells.PasteSpecial Paste:=xlPasteFormats
newWorkbook.Worksheets(1).Cells.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
newWorkbook.Worksheets(1).Range("A:A").ClearContents
newWorkbook.Worksheets(1).Name = "Values"
Application.CutCopyMode = False
Application.CutCopyMode = True
newWorkbook.Sheets.Add.Name = "XL FILE"
newWorkbook.Sheets("XL FILE").Move After:=Sheets("Values")
ThisWorkbook.Worksheets("XL FILE").Cells.Copy
newWorkbook.Worksheets("XL FILE").Cells.PasteSpecial Paste:=xlPasteFormats
newWorkbook.Worksheets("XL FILE").Cells.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Application.CutCopyMode = False
newWorkbook.SaveAs newWbPath
End if
Thanks in advance!