+ Reply to Thread
Results 1 to 4 of 4

Finding specific word in column

  1. #1
    Phil #3
    Guest

    Finding specific word in column

    I need to add the following to my present macro if possible.
    In column Q, which often contains a sentence or two of text, sometimes
    nothing, I need to add the function to find the word "waived", if present,
    from among the words in each cell and place a "W" into column N on the same
    row and if not present, put nothing then continue the macro.
    (XL2000, column currently formatted as "General").
    Phil




  2. #2
    Trevor Shuttleworth
    Guest

    Re: Finding specific word in column

    Phil

    one way, mostly from the VBA Help:

    Sub FindWaivedInQ()
    Dim c As Range
    Dim FirstAddress As String
    With Range("Q1:Q" & Range("Q" & Rows.Count).End(xlUp).Row)
    Set c = .Find("waived", LookIn:=xlValues)
    If Not c Is Nothing Then
    FirstAddress = c.Address
    Do
    c.Offset(0, -3).Value = "W"
    Set c = .FindNext(c)
    Loop While Not c Is Nothing And c.Address <> FirstAddress
    End If
    End With
    End Sub

    Regards

    Trevor


    "Phil #3" <[email protected]> wrote in message
    news:[email protected]...
    >I need to add the following to my present macro if possible.
    > In column Q, which often contains a sentence or two of text, sometimes
    > nothing, I need to add the function to find the word "waived", if present,
    > from among the words in each cell and place a "W" into column N on the
    > same row and if not present, put nothing then continue the macro.
    > (XL2000, column currently formatted as "General").
    > Phil
    >
    >
    >




  3. #3
    Phil #3
    Guest

    Re: Finding specific word in column

    This is exactly what I was looking for. It works perfectly.
    Thanks. You guys are genius'
    Phil

    "Trevor Shuttleworth" <[email protected]> wrote in message
    news:%[email protected]...
    > Phil
    >
    > one way, mostly from the VBA Help:
    >
    > Sub FindWaivedInQ()
    > Dim c As Range
    > Dim FirstAddress As String
    > With Range("Q1:Q" & Range("Q" & Rows.Count).End(xlUp).Row)
    > Set c = .Find("waived", LookIn:=xlValues)
    > If Not c Is Nothing Then
    > FirstAddress = c.Address
    > Do
    > c.Offset(0, -3).Value = "W"
    > Set c = .FindNext(c)
    > Loop While Not c Is Nothing And c.Address <> FirstAddress
    > End If
    > End With
    > End Sub
    >
    > Regards
    >
    > Trevor
    >
    >
    > "Phil #3" <[email protected]> wrote in message
    > news:[email protected]...
    >>I need to add the following to my present macro if possible.
    >> In column Q, which often contains a sentence or two of text, sometimes
    >> nothing, I need to add the function to find the word "waived", if
    >> present, from among the words in each cell and place a "W" into column N
    >> on the same row and if not present, put nothing then continue the macro.
    >> (XL2000, column currently formatted as "General").
    >> Phil
    >>
    >>
    >>

    >
    >




  4. #4
    Trevor Shuttleworth
    Guest

    Re: Finding specific word in column

    You're welcome. Thanks for the feedback.


    "Phil #3" <[email protected]> wrote in message
    news:[email protected]...
    > This is exactly what I was looking for. It works perfectly.
    > Thanks. You guys are genius'
    > Phil
    >
    > "Trevor Shuttleworth" <[email protected]> wrote in message
    > news:%[email protected]...
    >> Phil
    >>
    >> one way, mostly from the VBA Help:
    >>
    >> Sub FindWaivedInQ()
    >> Dim c As Range
    >> Dim FirstAddress As String
    >> With Range("Q1:Q" & Range("Q" & Rows.Count).End(xlUp).Row)
    >> Set c = .Find("waived", LookIn:=xlValues)
    >> If Not c Is Nothing Then
    >> FirstAddress = c.Address
    >> Do
    >> c.Offset(0, -3).Value = "W"
    >> Set c = .FindNext(c)
    >> Loop While Not c Is Nothing And c.Address <> FirstAddress
    >> End If
    >> End With
    >> End Sub
    >>
    >> Regards
    >>
    >> Trevor
    >>
    >>
    >> "Phil #3" <[email protected]> wrote in message
    >> news:[email protected]...
    >>>I need to add the following to my present macro if possible.
    >>> In column Q, which often contains a sentence or two of text, sometimes
    >>> nothing, I need to add the function to find the word "waived", if
    >>> present, from among the words in each cell and place a "W" into column N
    >>> on the same row and if not present, put nothing then continue the macro.
    >>> (XL2000, column currently formatted as "General").
    >>> Phil
    >>>
    >>>
    >>>

    >>
    >>

    >
    >




+ 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