You could use the VBA
equivalent of a standard COUNTIF formula (which can take more than one argument). This can be expanded as required
Standard Formula
=SUM(COUNTIF(A:A, {"SAL","PRE"}))
VBA Equivalent
MsgBox Evaluate("Sum(COUNTIF(A:A,{""PRE"",""SAL""}))")
More Related Contents:
- Want to concatenate multiple row data in in cell along with its values if present. Emp Id should not come if no data available infromt of it
- Excel Number Separation [closed]
- Excel formula checklist in employees
- Sequence of numbers based on start and end value of 2 cells [closed]
- Error in finding last used cell in Excel with VBA
- Excel VBA – How to add dynamic array formula
- Filling any empty cells with the value above
- Find last used cell in Excel VBA
- Count unique values in Excel
- Concatenate column headers if value in rows below is non-blank
- How do I apply a SumIf Formula in a VBA Sub? Getting Error 1004
- How to extract text within a string of text
- How to roundup a number to the closest ten?
- MS Excel: insert a row automatically if the content in a cell is <> that in cell of the last row?
- vba excel: how to copy characters from a cell to another
- Microsoft Excel ActiveX Controls Disabled?
- What is the default scope of worksheets and cells and range?
- Simple Pivot Table to Count Unique Values
- Are there disadvantages in putting code into Userforms instead of modules?
- Excel UNIQUE Across Columns
- Detect if range is empty
- Assign keyboard shortcut to run procedure
- Uncheck all checkboxes across entire workbook via CommandButton
- return csv file as recordset
- VBA workbooks.Close without being prompted to if the user wants to save?
- EntireRow.Delete performance issue
- How to extract groups of numbers from a string in vba
- Delete all data rows from an Excel table (apart from the first)
- Excel Hide/Show all tabs on Ribbon except custom tab
- Excel VBA Run-time Error ‘32809’ – Trying to Understand it