+ Reply to Thread
Results 1 to 6 of 6

Find a word "screenshot" and print value "yes" in adjacent Column

  1. #1
    Registered User
    Join Date
    05-29-2015
    Location
    India
    MS-Off Ver
    2013,2010
    Posts
    12

    Find a word "screenshot" and print value "yes" in adjacent Column

    Hi i need to check the cells in the column for the word "screenshot" and print "yes" in the adjacent column. I need to do this till data exists in the column..
    I want to run this loop till we get blank cell in the column.

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Find a word "screenshot" and print value "yes" in adjacent Column

    Hello
    Maybe a Do Until Loop, for example Column A until a blank cell is found:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-30-2014
    Location
    india
    MS-Off Ver
    2007
    Posts
    43

    Re: Find a word "screenshot" and print value "yes" in adjacent Column

    try this assuming data in column a

    Sub testing()

    Dim LastRow As Integer, x As Integer

    LastRow = Cells(Rows.Count, 1).End(xlUp).Row

    For x = 1 To LastRow
    If Cells(x, 1).Value = "screenshot" Then
    Cells(x, 2).Value = "yes"
    End If
    Next x

    End Sub

  4. #4
    Registered User
    Join Date
    05-29-2015
    Location
    India
    MS-Off Ver
    2013,2010
    Posts
    12

    Re: Find a word "screenshot" and print value "yes" in adjacent Column

    Quote Originally Posted by DBY View Post
    Hello
    Maybe a Do Until Loop, for example Column A until a blank cell is found:

    Please Login or Register  to view this content.
    Thanks for the help.. but the cell contains. multiple words.. like a statement. "screenshot is taken of the page" so for this input it gives me false output

  5. #5
    Registered User
    Join Date
    05-29-2015
    Location
    India
    MS-Off Ver
    2013,2010
    Posts
    12

    Re: Find a word "screenshot" and print value "yes" in adjacent Column

    Quote Originally Posted by globalsourcing View Post
    try this assuming data in column a

    Sub testing()

    Dim LastRow As Integer, x As Integer

    LastRow = Cells(Rows.Count, 1).End(xlUp).Row

    For x = 1 To LastRow
    If Cells(x, 1).Value = "screenshot" Then
    Cells(x, 2).Value = "yes"
    End If
    Next x

    End Sub
    thanks alot for a variation in code.. but it gives No if cell contains more than screenshot word... Please could u modify the code so that if there is statement in cell containing screenshot as word. it will print yes

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Find a word "screenshot" and print value "yes" in adjacent Column

    Hi
    Try the following code:

    Please Login or Register  to view this content.
    the UCase function makes this non-case sensitive but if you prefer it to be case sensitive then remove UCase.

+ 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: 5
    Last Post: 01-23-2014, 11:02 AM
  2. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  3. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  4. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  5. Replies: 5
    Last Post: 06-26-2006, 09:23 PM

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