Can someone please help me translate the following worksheet function for use in VBA?
=COUNTIFS(sheet1!$B53:$B2031,"*x*",sheet1!$C53:$C2031,$A2,sheet1!$E$47:$E$2025,"final*")
Thanks,
Willardio
Can someone please help me translate the following worksheet function for use in VBA?
=COUNTIFS(sheet1!$B53:$B2031,"*x*",sheet1!$C53:$C2031,$A2,sheet1!$E$47:$E$2025,"final*")
Thanks,
Willardio
Something like this? Range("A1").Formula = "=COUNTIFS(sheet1!$B53:$B2031,""*x*"",sheet1!$C53:$C2031,$A2,sheet1!$E$47:$E$2025,""final*"")"
Thanks JieJenn, but can I do it strictly using a VBA Worksheetfunction.Countifs code? I would like to translate the formula to work that way but can't seem to get the parameters straight without producing errors.
Here's an example
![]()
Please Login or Register to view this content.
I would like to add that if you like to countif only not empty cells in column A, the code would be:
Sub test()
Range("G2") = WorksheetFunction.CountIfs( _
Range("A:A"), "<>" & vbNullString, Range("B:B"), "*Final*")
End Sub
Expressed like a formula in cell G3:
=COUNTIFS(A:A;"<>"&"";B:B;"*Final*")
DonJuanBlanco
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks