Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 148
Default More to do with COMMENTS in Excel 2007

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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 301
Default More to do with COMMENTS in Excel 2007

Change this part:
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 39372
.TintAndShade = 0
.PatternTintAndShade = 0
End With

to:
Cells(cell.row,13).value=1

Bob Umlas
Excel MVP


"pcor" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 148
Default More to do with COMMENTS in Excel 2007


That did the trick. Many thanks

"Bob Umlas" wrote:

Change this part:
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 39372
.TintAndShade = 0
.PatternTintAndShade = 0
End With

to:
Cells(cell.row,13).value=1

Bob Umlas
Excel MVP


"pcor" wrote in message
...
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




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
Pasting a chart from Excel 2007 to Word 2007 trouble Vegas Charts and Charting in Excel 5 September 16th 08 07:37 AM
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
Exporting Quickbooks 2007 to Excel 2007 BShennum Excel Worksheet Functions 0 June 22nd 07 07:09 PM
Problems with my links to an excel 2007 file from a word 2007 file sc Links and Linking in Excel 0 February 21st 07 10:12 AM
comments in excel EGYPTIAN SUE Excel Worksheet Functions 2 July 19th 05 01:29 PM


All times are GMT +1. The time now is 12:33 AM.

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

About Us

"It's about Microsoft Excel"