Using arrays within a worksheet function in VBA

al_noggin

New Member
Joined
Jul 12, 2013
Messages
20
Hello,
I am looking to find a cell within a single column whose 10 left letters equals some text. Specifically in one column, I have a bunch of blank cells except for one cell that begins with the text: "Not Enough". I am looking to find a way to check that column to see if a cell like that exists. In Excel, I simply use the following array formula:
{=MATCH("Not Enough",LEFT('Output'!$D$7:$D$500,10),0)}

That works great, but I do not know how to do it in VBA. Any help would be much appreciated.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi al_noggin,

You can use the Worksheet.Evaluate Method to do that.

Code:
 Dim sAddr As String
 Dim vResult As Variant
 
 With Sheets("Output")
   sAddr = .Range("D7:D500").Address(External:=True)
   vResult = .Evaluate("=MATCH(""Not Enough"",LEFT(" & sAddr & ",10),0)")
   Debug.Print vResult
 End With
 
Upvote 0

Forum statistics

Threads
1,203,640
Messages
6,056,493
Members
444,870
Latest member
xuanhoi

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