1

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.

2
  • A relatively simple method would be to drop that formula into a cell offsheet where you can't see it normally. Then grab the value of that cell from VBA to get the calculated result from the formula. Commented Aug 30, 2012 at 17:59
  • Doug's answer is the right approach, but for completeness you can alternatively use ActiveSheet.Evaluate(yourFormula) where yourFormula is a variable containing a valid worksheet formula (including the "="). Commented Aug 30, 2012 at 20:28

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.