Home » excel » Excel VBA: 2 dimensional array search, check to see if cell is empty

Excel VBA: 2 dimensional array search, check to see if cell is empty

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a range of cells in excel with names of people on the left column and certain tasks (as numbers) on the top row, like a two dim array. All I want to do is be able to search for the name and numbered task to see if that cell is blank or not in VBA.

In the excel sheet I can use a formula like:
=ISBLANK(VLOOKUP(“Bob”, A2:AE33,3,FALSE))

which works, but can’t seem to find do this in VBA.

I’ve tried to just do something like this:

Application.WorksheetFunction.ISBLANK(Application.WorksheetFunction.VLookup(studentComboBox.Value, Range("A2:AE33"), i + 2, False))

But it gives an error like “object does not support this property or method”. Any help appreciated.

How to&Answers:

You don’t have access to ISBLANK via WorksheetFunction. Try: Application.WorksheetFunction.VLookup(studentComboBox.Value, Range("A2:AE33"), i + 2, False)=""