Help to change VBA Array Index Formula to remove #N/A leave blank

norman_bunch

New Member
Joined
Jan 24, 2012
Messages
18
Hello Board,

I am trying to figure out how I can change the following line of code to leave out the #N/A and just leave the cell values blank. I think that this would be an easy task but I can not figure it out.

Range("DS8:DS78").FormulaArray = "=INDEX('Cover Sheet'!$AA$46:$AA$68,MATCH(CV8:CV78&DD8:DD78,'Cover Sheet'!$D$46:$D$69&'Cover Sheet'!$L$46:$L$69,0))"

Please Help!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Do you want to end up with the formula in the cell, or just the result of the formula?
 
Upvote 0
If you want the formula in the cells, You can try
Code:
Range("DS8:DS78").FormulaArray = "=IF(ISNA(MATCH(CV8:CV78&DD8:DD78,'Cover Sheet'!$D$46:$D$69&'Cover Sheet'!$L$46:$L$69,0)),"""",INDEX('Cover Sheet'!$AA$46:$AA$68,MATCH(CV8:CV78&DD8:DD78,'Cover Sheet'!$D$46:$D$69&'Cover Sheet'!$L$46:$L$69,0)))"
 
Upvote 0
If you want the formula in the cells, You can try
Code:
Range("DS8:DS78").FormulaArray = "=IF(ISNA(MATCH(CV8:CV78&DD8:DD78,'Cover Sheet'!$D$46:$D$69&'Cover Sheet'!$L$46:$L$69,0)),"""",INDEX('Cover Sheet'!$AA$46:$AA$68,MATCH(CV8:CV78&DD8:DD78,'Cover Sheet'!$D$46:$D$69&'Cover Sheet'!$L$46:$L$69,0)))"
I would like to just end up with the result of the formula in the cell. Thanks for the update, I will give that a try once I get home.
 
Upvote 0
Try

Code:
With Range("DS8:DS78")
    .FormulaArray = "=IF(ISNA(MATCH(CV8:CV78&DD8:DD78,'Cover Sheet'!$D$46:$D$69&'Cover Sheet'!$L$46:$L$69,0)),"""",INDEX('Cover Sheet'!$AA$46:$AA$68,MATCH(CV8:CV78&DD8:DD78,'Cover Sheet'!$D$46:$D$69&'Cover Sheet'!$L$46:$L$69,0)))"
    .Value = .Value
End With
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,802
Members
449,095
Latest member
m_smith_solihull

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