dear friends I'm using above macro & it's work fine.i need to add two condition to it.if column "G" value " TP " then need to use this formula..With Range("S3:S" & Range("L" & Rows.Count).End(xlUp).Row) .Formula = "=IF(L3<=1.5,""1B"",IF(L3<=4.5,""1"",IF(L3<=12,""1A"",IF(L3<=30,""2"",IF(L3<=52.5,""3"",IF(L3<=60,""2"",IF(L3<=105,""3"",IF(L3<=210,""4A"",""4""))))))))" .Value = .Value
else.Formula = "=IF(L3<=1,""1B"",IF(L3<=3,""1"",IF(L3<=8,""1A"",IF(L3<=20,""2"",IF(L3<=35,""3"",IF(L3<=40,""2"",IF(L3<=70,""3"",IF(L3<=140,""4A"",""4""))))))))"
pls modify this macro for me.thanks....Formula = "=IF(L3<=1.5,""1B"",IF(L3<=4.5,""1"",IF(L3<=12,""1A"",IF(L3<=30,""2"",IF(L3<=52.5,""3"",IF(L3<=60,""2"",IF(L3<=105,""3"",IF(L3<=210,""4A"",""4""))))))))"
Last edited by johncena; 03-10-2010 at 09:14 AM.
If you wish to process all cells in one go perhaps:
With Range("S3:S" & Range("L" & Rows.Count).End(xlUp).Row) .Formula = "=LOOKUP(-SUM(L3),IF(TRIM(G3)=""TP"",{-9.99E+307,-140,-70,-40,-35,-20,-8,-3,-1},{-9.99E+307,-210,-105,-60,-52.5,-30,-12,-4.5,-1.5}),{4,""4A"",3,2,3,2,""1A"",1,""1B""})" .Value = .Value End With
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
wow thanks a lot DonkeyOte it's 200% working.thanks a lot again......
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks