Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a vlaue, shade another cell
I would like to search column c in an excel sheet for any number that starts
with '46'. all the numbers in the column will be 7 digits long (eg. 4634567) once found I would like to turn the font blue in the cell 10 columns to the right of this 46 cell. the macro should loop down column c until it can find no further values. any ideas if this is possible? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a vlaue, shade another cell
Hi,
Try this Sub Sonic() lastRow = Cells(Cells.Rows.Count, "C").End(xlUp).Row Set MyRange = Range("C1:C" & lastRow) For Each c In MyRange If Left(c.Value, 2) = "46" Then c.Offset(, 10).Font.ColorIndex = 5 End If Next End Sub Mike "Withnails" wrote: I would like to search column c in an excel sheet for any number that starts with '46'. all the numbers in the column will be 7 digits long (eg. 4634567) once found I would like to turn the font blue in the cell 10 columns to the right of this 46 cell. the macro should loop down column c until it can find no further values. any ideas if this is possible? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a vlaue, shade another cell
Hi
Try this: Sub Color46() FirstRow = 1 LastRow = Range("C" & Rows.Count).End(xlUp).Row For r = FirstRow To LastRow If Left(Range("C" & r), 2) = 46 Then Range("M" & r).Interior.ColorIndex = 5 End If Next End Sub Regards, Per "Withnails" skrev i meddelelsen ... I would like to search column c in an excel sheet for any number that starts with '46'. all the numbers in the column will be 7 digits long (eg. 4634567) once found I would like to turn the font blue in the cell 10 columns to the right of this 46 cell. the macro should loop down column c until it can find no further values. any ideas if this is possible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
shade one cell that will shade multiple cells | Excel Discussion (Misc queries) | |||
Return value based on another vlaue | Excel Worksheet Functions | |||
Shade Active Cell - Shade the cell the cursor is in only while in | Excel Programming | |||
#vlaue! | New Users to Excel | |||
How to detect if there is change in any cell vlaue in a worksheet? | Excel Programming |