Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hello good evening hope you can help me please? I have the code below which works great and it counts the word ‘CAG’. But it doesn’t count if their is another word before or after it. For example ‘cancelled cag’ or ‘cag replanned’. Hope you can help please.
VBA Code:
Private Sub userform_initialize()
Dim j As Long
j = Application.WorksheetFunction.CountIf(ThisWorkbook.Sheets("In Day VL").Range("A:A"), "CAG",)
UserForm1.TextBox2.Value = j
End Sub