Help!

More to do with COMMENTS in Excel 2007


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> New Users RSS
Next:  Coloring of cell when entering data  
Author Message
pcor
External


Since: Apr 12, 2006
Posts: 50



PostPosted: Mon Aug 06, 2007 1:04 pm    Post subject: More to do with COMMENTS in Excel 2007
Archived from groups: microsoft>public>excel>newusers (more info?)

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
Back to top
Bob Umlas
External


Since: Oct 30, 2004
Posts: 301



PostPosted: Mon Aug 06, 2007 4:35 pm    Post subject: Re: More to do with COMMENTS in Excel 2007 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <pcor RemoveThis @discussions.microsoft.com> wrote in message
news:E785E27F-1851-472D-BB1A-411BEDAC2634@microsoft.com...
> 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
Back to top
pcor
External


Since: Apr 12, 2006
Posts: 50



PostPosted: Mon Aug 06, 2007 4:35 pm    Post subject: Re: More to do with COMMENTS in Excel 2007 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <pcor.TakeThisOut@discussions.microsoft.com> wrote in message
> news:E785E27F-1851-472D-BB1A-411BEDAC2634@microsoft.com...
> > 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
>
>
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> New Users All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum