Iferror index and match formula in VBA

A Thayuman

New Member
Joined
Mar 6, 2019
Messages
30
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1QTYItem NumberDescription PriceUnitDisc %Total
2 EL-PL24W0612A 24W LED Panel Light 600x1200mm $ 30.00  
3 #N/A  
4 #N/A  
5
6
7The idea of using Index and match in VBA is so that I can overwirte the description when needed without having to worry about deleting the formula.
8Data Validation TableFormula is rewirtten when the sheet is opend for use again
9However when:
10Item Number Description
11EL-PL36W0612A36W LED Panel Light 600x1200mmThis Code "=INDEX($E$11:$E15,MATCH(C2, $C$11:$C$15, 0))" inbeds in the cell I choose, it works fine when activated on opening the sheet by VBA: =INDEX($Z$3:$Z$30,MATCH(C2, $W$3:$W$30, 0))
12EL-PL24W0612A 24W LED Panel Light 600x1200mmHowerver when Cell "C" has no information the "F2" shows #N/A
13EL-PL24W0312A 24W LED Panel Light 300x1200mm
14EL-PL24W0606A24W LED Panel Light 600x600mmThis formula pasted as a code in VBA does not work at all "=IFERROR(=INDEX($E$11:$E15,MATCH(C2, $C$11:$C$15, 0))," ")"
15EL-PL12W0306A 12W LED Panel Light 300x600mmAnd a message window pops up with "Complie Error, Expected: End Statement
16
17
18
Sheet1
Cell Formulas
RangeFormula
F2:F4F2=INDEX($E$11:$E15,MATCH(C2, $C$11:$C$15, 0))
M3:M4M3=IFERROR(INDEX($AA$3:$AA$30,MATCH(C3, $W$3:$W$30, 0))," ")
O3:O4O3=IFERROR(INDEX($AB$3:$AB$30,MATCH(C3, $W$3:$W$30, 0))," ")
S2:S4S2=IFERROR((A2*M2) -(A2*M2*Q2),0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C15:D15,C11:D13Cell ValueduplicatestextNO
Cells with Data Validation
CellAllowCriteria
C2:E4List=$C$11:$C$15
 
Apparently you seem to be working with Merged Cells ...

Merged Cells are a total disaster ...!!!:mad: and preventing you from working with Excel ...(n)

Just get rid of them ...
Hi James the solution provided by Fulff as seen above works perfectly with merged cells - its great to have merged cells for formatting Thanks for your offering to help it is much appreciated
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi Fluff thanks works perfectly thanks for your help
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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