Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Phil #3
 
Posts: n/a
Default 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   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

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" wrote in message
et...
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   Report Post  
Phil #3
 
Posts: n/a
Default

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

"Trevor Shuttleworth" wrote in message
...
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" wrote in message
et...
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   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

You're welcome. Thanks for the feedback.


"Phil #3" wrote in message
ink.net...
This is exactly what I was looking for. It works perfectly.
Thanks. You guys are genius' :)
Phil

"Trevor Shuttleworth" wrote in message
...
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" wrote in message
et...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Words In Excel Spreadsheets & Word Documents rbonner79416 Excel Discussion (Misc queries) 0 March 18th 05 04:25 PM
Is This POSSIBLE Rebecca New Users to Excel 8 March 3rd 05 07:05 PM
Counting unique entries in column A but only if specific values appear in columns B and C markx Excel Worksheet Functions 1 February 10th 05 11:52 AM
Finding and Deleting duplicates in a column Brian Excel Worksheet Functions 3 February 5th 05 02:19 PM
Getting specific data from a word document into an excel sheet smintey Excel Worksheet Functions 3 December 7th 04 05:17 PM


All times are GMT +1. The time now is 07:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"