+ Reply to Thread
Results 1 to 4 of 4

Macro to change text in cell if it detects any value in another cell in the same row

Hybrid View

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    24

    Macro to change text in cell if it detects any value in another cell in the same row

    Hi, I'm basically trying to change the text in cell if it detects any value in another cell, however if the the row is completely empty then it should stay blank.

    Eg. If Column C has any value then Column D should say "Associated with Siebel No", if Column C is empty then Column D should say "No Siebel No" in the corresponding row. Also if the entire row is blank then Column D should also stay blank.

    I tried a simple IF statement in Column D =IF(O15=0,"No Siebel Number","Associated with Siebel Number") but that that does not work the way I want it and neither am I good at making macros from scratch.

    I hope this makes sense, I've attached a sample of my database below to help.


    Example.xlsm

    I appreciate any help
    Thanks in advance!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,114

    Re: Macro to change text in cell if it detects any value in another cell in the same row

    You don't need a macro.

    In your example:

    D4: =IF(COUNTA($B4:$C4)=0,"",IF($C4="","No Siebel Number","Associated with Siebel Number"))


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-03-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Macro to change text in cell if it detects any value in another cell in the same row

    Thanks alot mate

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,114

    Re: Macro to change text in cell if it detects any value in another cell in the same row

    You're welcome.

+ 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