CarlStephens
Board Regular
- Joined
- Sep 25, 2020
- Messages
- 128
- Office Version
- 2016
- Platform
- Windows
Hello All,
In the below code highlighted bold, there is in column AQ a possibility that there could be a "Yes" in the cell. Is there a code to add to the below, that will say in addition to the " new employee records found" (in red below), that the code will also count the number of "Yes" cells and pop up in the same message box as "new employee records found"? Thank you.
With wsData.Rows(1)
.AutoFilter Field:=42, Criteria1:="Not On Joiners List"
.AutoFilter Field:=43, Criteria1:="<90"
If wsData.Range("H1:H" & lr).SpecialCells(xlCellTypeVisible).Cells.Count > 1 Then
wsData.Range("AR2:AU" & lr).SpecialCells(xlCellTypeVisible).Copy
wsDest.Range("AC" & Rows.Count).End(3)(2).PasteSpecial Paste:=xlPasteValues
wsDest.Select
MsgBox wsData.Range("H1:H" & lr).SpecialCells(xlCellTypeVisible).Cells.Count - 1 & " new employee records were found."
Else
MsgBox "No new employee postings found."
End If
In the below code highlighted bold, there is in column AQ a possibility that there could be a "Yes" in the cell. Is there a code to add to the below, that will say in addition to the " new employee records found" (in red below), that the code will also count the number of "Yes" cells and pop up in the same message box as "new employee records found"? Thank you.
With wsData.Rows(1)
.AutoFilter Field:=42, Criteria1:="Not On Joiners List"
.AutoFilter Field:=43, Criteria1:="<90"
If wsData.Range("H1:H" & lr).SpecialCells(xlCellTypeVisible).Cells.Count > 1 Then
wsData.Range("AR2:AU" & lr).SpecialCells(xlCellTypeVisible).Copy
wsDest.Range("AC" & Rows.Count).End(3)(2).PasteSpecial Paste:=xlPasteValues
wsDest.Select
MsgBox wsData.Range("H1:H" & lr).SpecialCells(xlCellTypeVisible).Cells.Count - 1 & " new employee records were found."
Else
MsgBox "No new employee postings found."
End If