Avatar of morinia
morinia
Flag for United States of America asked on

defining and comparing the value of a cell in VB

I have the following statement in VB;

PROD = Cells(stateRow, 2).Value

I am trying to compare the contents of this cell (which changes relative to the row)
The length of the contents is variable.

I would like to compare the contents of this cell to another cell (PRODX)  on a spreadsheet to use in a sumifs statement in VB.

The challenge is the the value of PRODX can be the value of PROD  & "*"  

Can someone tell me how to code a sumif in VB comparing PROD to PROD X.

This is an example of what I am using when I am matching two fields that are the same length

totYr = Round(Application.WorksheetFunction.SumIfs(Range("pAuths"), _
                              Range("pEvent"), evtType, _
                              Range("pYr"), Pyr, _
                              Range("ProdX"), PROD) / Members, 2)
Microsoft Excel

Avatar of undefined
Last Comment
Frank White

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Frank White

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck