Hello ,
I need to cut the rows after I copied them in the new sheet (If Not foundTrue Then...)
Does someone know how to add this function in the macro below and how to add a pop up window if everything is found :True ?
Thanks in advance!
______________________________________________________________
Sub compareAndCopyBRvsCommence()
Dim lastRowE As Integer
Dim lastRowF As Integer
Dim lastRowM As Integer
Dim foundTrue As Boolean
Dim New_file_name
Sheets(3).Select
Worksheets.Add
Sheets(3).Name = "Project_Not_Closed"
Application.ScreenUpdating = False
lastRowE = Sheets("Commence").Cells(Sheets("Commence").Rows.Count, "K").End(xlUp).Row
lastRowF = Sheets("Commence").Cells(Sheets("Commence").Rows.Count, "AJ").End(xlUp).Row
lastRowM = Sheets("Project_Not_Closed").Cells(Sheets("Project_Not_Closed").Rows.Count, "A").End(xlUp).Row
For i = 2 To lastRowE
foundTrue = False
For J = 2 To lastRowF
If Sheets("Commence").Cells(J, 36).Value = Sheets("Commence").Cells(i, 11).Value Then
foundTrue = True
Exit For
End If
Next J
If Not foundTrue Then
Sheets("Commence").Rows(i).Copy Destination:= _
Sheets("Project_Not_Closed").Rows(lastRowM + 1)
lastRowM = lastRowM + 1
End If
Next i
Sheets("Project_Not_Closed").Activate
Cells(1, 1) = "Project not Closed"
Application.ScreenUpdating = True
'New_file_name = Application.GetSaveAsFilename(, "Microsoft Excel Workbook (*.xls), *.xls")
'ActiveSheet.Copy
'ActiveWorkbook.SaveAs Filename:=New_file_name, FileFormat:=xlNormal
'ActiveWindow.Close
'Sheets("Mismatch BR_Commence").Delete
End Sub
Bookmarks