Multiple conditions in IF statement in a for each row

I am trying to locate a specific cell to assign the value of that cell to a variable to where I can paste that variable value to another Excel worksheet. I have 3 conditions that need to be met, if column A of the data table contains a previously assigned variable, column B = PAR, and column C equals a preassigned date.

Then would be to assign the value of that cell to a variable, the else would be to look at the next row.

Any help would be very appreciated!


Hi @RPANovice1,

Can you please give me an sample input data and expected result from that, so that we can give the solution correctly.


Thanks for the response. I have pasted a small sample below… Sorry it looks unclear. However what I am trying to find is the settlement amount. So for example if our date is 2/4, I want the 172,586.91 to be saved in a variable so it can be pasted in another Excel sheet.

Plan Number Par/Ctr Settle Date Settlement Amount
040-00 PAR 2/1/2019 76,203.59
040-00 PAR 2/4/2019 172,586.91
040-00 PAR 2/8/2019 28,131.50-
040-00 PAR 2/11/2019 245,965.00-

Hi @RPANovice1,
You said multiple if conditions but here you are mentioned only one if condition.

Convert.ToString(Row("Settle date"))="2/4/2019"
If yes->
StrAmount=Convert.ToString(Row("Settlement Amount"))

If you missed any condition please let me know

Thanks for responding, sorry my brain fails me on Friday afternoon. The other conditions would be Plan number above would contain the values of a variable (HomePlan) which in this case the value in that variable would be 040. The other condition would be the Par/Ctr = PAR.

@arivu96 One more issue… I have attached a copy of my IF statement, but I am getting the infamous Option strict On disallows late binding. I am having no luck in figuring out how to fix…