+ Reply to Thread
Results 1 to 5 of 5

VBA script to insert text in cell if a different cell in row does not contain specific txt

  1. #1
    Forum Contributor
    Join Date
    02-16-2006
    Posts
    241

    VBA script to insert text in cell if a different cell in row does not contain specific txt

    I have a spreadsheet with multiple rows. I need to be able to look at cells ("A:A") and if they do not contain the text "SSD" put "N/A" in column F, if they do not contain the text "PO45" put "N/A" in column G, if they do not contain the text "IC82" put "N/A" in column H, or if they do not contain the text "R12" put "N/A" in column I. (See attached file for example)

    Any help is appreciated.


    Thanks,

    Met
    Attached Files Attached Files
    Last edited by Metrazal; 10-28-2014 at 12:15 PM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA script to insert text in cell if a different cell in row does not contain specific

    Hi Met,
    Try the attached
    Attached Files Attached Files
    Last edited by AB33; 10-28-2014 at 02:41 PM.

  3. #3
    Forum Contributor
    Join Date
    02-16-2006
    Posts
    241

    Re: VBA script to insert text in cell if a different cell in row does not contain specific

    Wow. Very good. It is going to take me a while to decipher this and apply to my real worksheet but I really appreciate the help.

    One quick question: How would I apply this to update the sheet "Sheet1" instead of the "Desired Results" sheet?

    Thanks,

    Met

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA script to insert text in cell if a different cell in row does not contain specific

    Change this line of the code

    Please Login or Register  to view this content.
    Mind you, to save time looping I have assumed the gap in the sting is 2, not 1.
    If you look at this line

    Please Login or Register  to view this content.
    It is assumed it is 2 null string. Watch out on your output

  5. #5
    Forum Contributor
    Join Date
    02-16-2006
    Posts
    241

    Re: VBA script to insert text in cell if a different cell in row does not contain specific

    Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 10-28-2015, 10:22 AM
  2. Replies: 1
    Last Post: 08-26-2014, 02:49 PM
  3. Replies: 3
    Last Post: 07-12-2013, 09:17 AM
  4. Insert cell A value into default text cell D for each specific row
    By badasstoymaster in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2010, 03:40 PM
  5. Replies: 3
    Last Post: 05-29-2007, 04:07 AM

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