+ Reply to Thread
Results 1 to 4 of 4

Two IF statements that result in added text to cell

  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    47

    Two IF statements that result in added text to cell

    Hello! First time posting here. I know very little VBA but am usually I'm able to find what I need by scouring the web. Unfortunately, this is a fairly specific problem and I can't find it on my own. I was hoping someone nice could help me out here.

    WHAT I NEED:

    If D3A, D3B, D6A, or D6B appear anywhere in a cell in column AB, and there is data in its adjacent cell in column AC, then add 001 to the front of the data in the cell in column AC.


    Thank you!

    -Adam

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Two IF statements that result in added text to cell

    Backup your data!
    Copy code to a standard module.
    Run: ModifyData

    Please Login or Register  to view this content.

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

    Re: Two IF statements that result in added text to cell

    Hi Adam,

    Welcome to the forum.

    See the attached file where I have used If and OR functions to achieve the desired results:-

    Two If statements.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    07-13-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Two IF statements that result in added text to cell

    StevenM,

    Thanks! I had to add another line in there to format the column as text so it would show the preceding zeroes.


    Dili,

    Thanks for the formulas. I should have said that adding another column wasn't really an option. I had to change the current one so I needed a script I believe.

+ 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