Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default 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
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
shade one cell that will shade multiple cells Walt Excel Discussion (Misc queries) 1 November 17th 09 03:46 PM
Return value based on another vlaue Jesse Excel Worksheet Functions 1 June 19th 09 09:08 PM
Shade Active Cell - Shade the cell the cursor is in only while in Lisa Excel Programming 2 April 17th 07 10:00 PM
#vlaue! Rao Ratan Singh New Users to Excel 1 January 16th 06 01:42 PM
How to detect if there is change in any cell vlaue in a worksheet? Ai_Jun_Zhang[_10_] Excel Programming 2 September 20th 05 12:31 AM


All times are GMT +1. The time now is 04:10 PM.

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"