+ Reply to Thread
Results 1 to 5 of 5

Find (x), insert If statement to right

  1. #1
    Registered User
    Join Date
    03-17-2011
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    63

    Find (x), insert If statement to right

    Greetings:

    Have multiple workbooks, totalling thousands of rows to check.
    When text (P.O.A.) is found in column F, Column E needs to have a "1" inserted, and Column G requires an IF Statement.

    I'm drawing a blank on how to search for the text "P.O.A."

    The adjustment required on cell to the left works as shown.

    The Insertion of the IF statement is not working either.
    1: Doesn't matter what I try with the quote marks, it always comes up with "compile error: Expected end of statement".
    If I drop the equals sign in front of the IF, it will insert the text into the cell, but that is not what is needed.
    2: The IF statement must indicate the row number that it is being inserted on.

    I understand that looping is not the most efficient way to do multiple instances.
    Efficiency is a concern, due to size of workbooks.

    Thank-you

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Find (x), insert If statement to right

    Hi,

    You need double quotes round the space literal.

    i.e.

    Please Login or Register  to view this content.
    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-17-2011
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Find (x), insert If statement to right

    Thanks Richard:

    I've changed that line. It does insert the IF statement, BUT, it also adds single quotes around the cell address.
    Obviously more code is needed to make this work, so that the cell address will 'match' the row that the IF statement is placed on.
    Please Login or Register  to view this content.
    What is actually inserts into the Cell is: =IF('E51'<>0,'F51'," ")
    What would be the next step?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Find (x), insert If statement to right

    Hi,
    Try

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-17-2011
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    63

    Thumbs up Re: Find (x), insert If statement to right

    Perseverance does sometimes pay off.

    I now have the following, which seems to the trick.
    The only thing left now, is to loop or repeat the code.
    Any Ideas? I can't use go to blank space, or anything link that.
    I could use column B as finding last row.
    ??

    Please Login or Register  to view this content.

+ 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