ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP! (https://www.excelbanter.com/excel-programming/358678-help.html)

erikkeith via OfficeKB.com

HELP!
 
I need to figure out a way to color code a cell off a selection find. Here
is what I currently have:

Range("O1,O12,O34").Select
If Range("AD28").Value = "N" And Application.CountIf(Range("O12:O85"),
"Steve") = 0 Then
On Error Resume Next
Selection.Find(What:="Alternate", LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Replace What:="Alternate", Replacement:="Steve", LookAt:
=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End If

If the condition is met and the name Steve is input into cell O1, O12 or O34,
I want where ever it is populated to have a specific cell color. How can I
write this into what I have?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200604/1

FSt1

HELP!
 
hi,
add this after the replace...
activecell.interior.colorindex = 5 'blue
to find out all of the color indexes, paste this code in a standard module
in a blank workbook.

Sub macGetColors()
' Macro written 2/10/02 by FSt1

Sheets("Sheet1").Select
Range("B2").Select
Set ci = Range("A1")
ci.Value = 1
Set c = Range("B2")
Do Until ci 56
Set c2 = c.Offset(1, 0)
Set cnum = c.Offset(0, 1)
c.Interior.ColorIndex = ci.Value
c.Offset(0, 1) = ci.Value
ci.Value = ci.Value + 1
Set c = c2
c.Select
Loop

End Sub

regards
FSt1

"erikkeith via OfficeKB.com" wrote:

I need to figure out a way to color code a cell off a selection find. Here
is what I currently have:

Range("O1,O12,O34").Select
If Range("AD28").Value = "N" And Application.CountIf(Range("O12:O85"),
"Steve") = 0 Then
On Error Resume Next
Selection.Find(What:="Alternate", LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Replace What:="Alternate", Replacement:="Steve", LookAt:
=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End If

If the condition is met and the name Steve is input into cell O1, O12 or O34,
I want where ever it is populated to have a specific cell color. How can I
write this into what I have?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200604/1



All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com