+ Reply to Thread
Results 1 to 3 of 3

Thread: column value base on macro formula

  1. #1
    Valued Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    312

    Post column value base on macro 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
    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..
        .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""))))))))"
    else
        .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""))))))))"
    pls modify this macro for me.thanks...
    Last edited by johncena; 03-10-2010 at 09:14 AM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: column value base on macro formula

    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

  3. #3
    Valued Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    312

    Re: column value base on macro formula

    wow thanks a lot DonkeyOte it's 200% working.thanks a lot again......

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0