+ Reply to Thread
Results 1 to 6 of 6

Problem in writing if condition in VBA

  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    27

    Problem in writing if condition in VBA

    I have a problem while writing a if condition formula in excelVBA

    example

    Situation 1 (range)
    a b
    1 180 Small variance
    2 151 small variance
    3 280 small variance
    4

    Situation 2 (range)
    5 350 Non reconciled
    6 210 non reconciled
    7 160 non reconciled
    8 145 non reconciled
    9 450 non reconciled
    10

    here i have mentioned Aging in Column A and Status in Column B. Cell A4 is blanck cell and A10 is blank cell

    Situation 1
    I need if any cell contains >150 aging then is Small Variance

    Situation 2
    if any one of cell (from A5-A10) acontains <=150 then all cell would result Non reconciled, even though the rest of cell are >150 aging. In this situation A8 is 145 and rest of all cells are >150 aging.

    I have more than 10000 line items in my worksheet.

    Could you please help

    Thanks,
    Pradeep

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Problem in writing if condition in VBA

    Hi Pradeep,

    I am not clear with you query, can you upload an excel workbook along with your expected results.. thx


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    08-08-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Problem in writing if condition in VBA

    Hi Dilip,

    Thanks for your quick response...

    Here is the attachment for your reference....


    Could you please help me on this issue...

    Thanks & Regards,
    Pradeep
    Attached Files Attached Files

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Problem in writing if condition in VBA

    Are you treating numbers in column A as set (batch) e.g., A5 is one set, A7 is another set, A9:A10 is another set... etc ?


    If not, then logic is simple... <151 = Non reconciling item and >151 = small variance for clearance


    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Problem in writing if condition in VBA

    Maybe this

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  6. #6
    Registered User
    Join Date
    08-08-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Problem in writing if condition in VBA

    Hi Mike,

    A Very Good Morning...

    Thanks a lot Mike.... its working perfectly...


    Thanks & regards,
    Pradeep

+ 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.6.0 RC 1