Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / August 2007

Tip: Looking for answers? Try searching our database.

More to do with COMMENTS in Excel 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pcor - 06 Aug 2007 21:04 GMT
Dim i As Integer
Dim myText As String, List, myTotal As Double
Dim cell As Range
Set cmt = ActiveSheet.Comments
Set rng1 = Range("target")
Selection.SpecialCells(xlCellTypeComments).Select

For Each cell In Selection
 cell.Select
 myTotal = 0
 
 myText = UCase(cell.Comment.Text)
 If InStr(myText, rng1) Then
 cc = col
   With Selection.Interior
       .Pattern = xlSolid
       .PatternColorIndex = xlAutomatic
       .Color = 39372
       .TintAndShade = 0
       .PatternTintAndShade = 0
   End With
   End If

 
Next cell
End Sub
The code above reads all the COMMENTS in columns A to I looking for a given
word. When that target word is found it colors the cell brown.
I would much prefer to NOT COLOR the cell but to place a 1(one) in a column
M on the same line as where the target word was found.
I would appreciate any help\Thanks
Bob Umlas - 06 Aug 2007 21:35 GMT
Change this part:
>    With Selection.Interior
>        .Pattern = xlSolid
[quoted text clipped - 3 lines]
>        .PatternTintAndShade = 0
>    End With
to:
Cells(cell.row,13).value=1

Bob Umlas
Excel MVP

> Dim i As Integer
> Dim myText As String, List, myTotal As Double
[quoted text clipped - 28 lines]
> M on the same line as where the target word was found.
> I would appreciate any help\Thanks
pcor - 06 Aug 2007 22:52 GMT
That did the trick. Many thanks

> Change this part:
> >    With Selection.Interior
[quoted text clipped - 42 lines]
> > M on the same line as where the target word was found.
> > I would appreciate any help\Thanks

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.