macro modification help

danushka

Well-known Member
Joined
Sep 6, 2009
Messages
693
Dear friends below macro code work fine.i want to add another condition to this code..my macro code is..

Code:
With Range("S3:S" & Range("L" & Rows.Count).End(xlUp).Row)
    .Formula = "=LOOKUP(-SUM(L3),IF(OR(TRIM(G3)={[COLOR=Red]""TP"",""EMB""[/COLOR]}),{-9.99E+307,-140,-70,-40,-16,-9,-3,-1},{-9.99E+307,-210,-105,-60,-24,-13.5,-4.5,-1.5}),{4,""4A"",3,2,""2AB"",""1A"",1,""1B""})"
    .Value = .Value
End With

I want to add ""TP"",""EMB"" condition with ""BHT"".because this all three is same.i have tried below but it's not work..pls help me..

Code:
With Range("S3:S" & Range("L" & Rows.Count).End(xlUp).Row)
    .Formula = "=LOOKUP(-SUM(L3),IF(OR(TRIM(G3)={[COLOR=Red]""TP"",""EMB"",""BHT""[/COLOR]}),{-9.99E+307,-140,-70,-40,-16,-9,-3,-1},{-9.99E+307,-210,-105,-60,-24,-13.5,-4.5,-1.5}),{4,""4A"",3,2,""2AB"",""1A"",1,""1B""})"
    .Value = .Value
End With
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

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