Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a cell identified by either the word "Unbene" or the interior cell
colour. I want to write a macro that will identify that cell and then colour 9 cells in the same row. The word is in cell C and I want cells A-I change to a colour I designate. Is this clearer? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is kind of bulky, but it works.
Sub findWord() lastRow = Cells(Rows.Count, 3).End(xlUp).Row For Each c In Range("C2:C" & lastRow) If c = "Unbene" Then x = c.Address Range("A" & Range(x).Row & ":I" & Range(x).Row).Interior.ColorIndex = 3 End If Next End Sub "tiger" wrote: I have a cell identified by either the word "Unbene" or the interior cell colour. I want to write a macro that will identify that cell and then colour 9 cells in the same row. The word is in cell C and I want cells A-I change to a colour I designate. Is this clearer? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe less bulky:
If c = "Unbene" Then c.offset(0,-2).resize(1,9).Interior.ColorIndex = 3 End If or even c.entirerow.cells(1).resize(1,9).Interior.ColorInd ex = 3 JLGWhiz wrote: This is kind of bulky, but it works. Sub findWord() lastRow = Cells(Rows.Count, 3).End(xlUp).Row For Each c In Range("C2:C" & lastRow) If c = "Unbene" Then x = c.Address Range("A" & Range(x).Row & ":I" & Range(x).Row).Interior.ColorIndex = 3 End If Next End Sub "tiger" wrote: I have a cell identified by either the word "Unbene" or the interior cell colour. I want to write a macro that will identify that cell and then colour 9 cells in the same row. The word is in cell C and I want cells A-I change to a colour I designate. Is this clearer? -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another
If only ONE, then find might be best. If not, use the loop provided or FINDNEXT. myrow=columns("c").find("Unbene").row range(cells(myrow,"a"),cells(myrow,"i")).interior. colorindex=6 -- Don Guillett Excel MVP SalesAid Software "tiger" wrote in message ... I have a cell identified by either the word "Unbene" or the interior cell colour. I want to write a macro that will identify that cell and then colour 9 cells in the same row. The word is in cell C and I want cells A-I change to a colour I designate. Is this clearer? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using CF to change colour in cell based on date? | Excel Discussion (Misc queries) | |||
how do i change cell text colour based on value in other cell | Excel Worksheet Functions | |||
change current cell colour based on the value of adjacent cell on other worksheet | Excel Programming | |||
How to change cell colour based on numer of months? | Excel Programming | |||
Change the colour of a bunch of cells, based on one cell. | Excel Programming |