Index match and isnull

SeanWise

New Member
Joined
Dec 2, 2016
Messages
17
So I've been trying without much success to integrate isnull into my Index/Match vba code.

Basically, the program needs to find a Date in column C, this date was presaved in a variable called YRow.
Then it needs to check whether a corresponding row in Column E is blank.
After that, it'll take action as necessary.

I've been playing with this, but no dice:

Code:
If IsEmpty(Application.Evaluate("=INDEX(ActiveSheet.Range("E:E") ,MATCH("YRow, Activesheet.Range("C:C"),0))").Value) = True Then
     MsgBox "It's Empty"  <---this is just for debugging
End If

Any ideas?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try this:
Code:
If IsEmpty(Application.Evaluate("INDEX(" & ActiveSheet.Range("E:E").Address & ",MATCH(YRow," & ActiveSheet.Range("C:C").Address & ",0))")) Then ...
 
Upvote 0
Thank you , but unfortunately, that code now just skips the msgBox. I need the code to return 0 or 1 or true or similar if column E is blank. If it is blank, It needs to run other code.
 
Upvote 0
Thank you , but unfortunately, that code now just skips the msgBox. I need the code to return 0 or 1 or true or similar if column E is blank. If it is blank, It needs to run other code.
I just made your IsEmpty(Application.Evaluate(...)) construct working; the rest is up to you.

If it skips the MsgBox, then either YRow is not found in column C or the corresponding cell in column E is not empty.
Being "empty-looking" or "blank-looking" does not necessarily mean being empty.
 
Upvote 0
Ok, so I changed it to this:

Code:
var1 = Application.Evaluate("INDEX(" & ActiveSheet.Range("E9:E1000").Address & ",MATCH(YRow," & ActiveSheet.Range("C9:C1000").Address & ",0))")
If var1 = 0 Then

but I keep getting a "run time error 13: type mismatch ". I have changed Var1 to long, string, double, integer and even variant, but get the same error.
Been doing this all day. I cannot find the solution no matter how hard I try. Another hint please?
 
Upvote 0
Ok, so I changed it to this:

Code:
var1 = Application.Evaluate("INDEX(" & ActiveSheet.Range("E9:E1000").Address & ",MATCH(YRow," & ActiveSheet.Range("C9:C1000").Address & ",0))")
If var1 = 0 Then

but I keep getting a "run time error 13: type mismatch ". I have changed Var1 to long, string, double, integer and even variant, but get the same error.
Been doing this all day. I cannot find the solution no matter how hard I try. Another hint please?
Hint: this happens because YRow is not found in ActiveSheet.Range("C9:C1000").
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,318
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top