use this one

Sub ChangeRowColor()

Dim sheet As Worksheet
Dim row_min As Integer
Dim row_max As Integer
Dim rowC As Long

    ' Select the used range.
    Set sheet = ActiveSheet
    'sheet.UsedRange.Select

    ' Display the range's rows and columns.
    row_min = sheet.UsedRange.Row
    row_max = row_min + sheet.UsedRange.Rows.Count - 1


    For rowC = row_min To row_max
             With sheet.Range("c" & rowC).EntireRow.Font
                .Color = sheet.Range("C" & rowC).Font.Color
                 .TintAndShade = 0
            End With
     Next


End Sub


or

if you want to change color only used cells

Sub ChangeRowColorOnlyUsedCells()

Dim sheet As Worksheet
Dim row_min As Integer
Dim row_max As Integer
Dim col_min As Integer
Dim col_max As Integer
Dim rowC As Long
Dim colC As Long

    ' Select the used range.
    Set sheet = ActiveSheet
    'sheet.UsedRange.Select

    ' Display the range's rows and columns.
    row_min = sheet.UsedRange.Row
    row_max = row_min + sheet.UsedRange.Rows.Count - 1
    col_min = sheet.UsedRange.Column
    col_max = col_min + sheet.UsedRange.Columns.Count - 1

    For rowC = row_min To row_max
        For colC = col_min To col_max
            With sheet.Cells(rowC, colC).Font
                .Color = sheet.Range("C" & rowC).Font.Color
                 .TintAndShade = 0
            End With
        Next
  Next

End Sub


or

if you want change on particular cell color change event then used this one
(Few modification in noorain code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = "3" And Target.Value <> "" Then
Target.EntireRow.Font.Color = Target.Cells.Font.Color
End If
End Sub



On Thu, Jul 5, 2012 at 4:13 PM, NOORAIN ANSARI <noorain.ans...@gmail.com>wrote:

> Dear Amit,
>
> Please try it..
>
> *Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> If Target.Column = "3" And Target.Value <> "" Then
> Target.EntireRow.Interior.ColorIndex = Target.Cells.Font.ColorIndex
> End If
> End Sub
> *
>
>
> --
> Thanks & regards,
> Noorain Ansari
> www.noorainansari.com
> www.excelmacroworld.blogspot.com
>
> On Thu, Jul 5, 2012 at 3:51 PM, Amit Gandhi <silkyro...@gmail.com> wrote:
>
>> Hi Experts
>>
>> I need a macro which changes the FONT COLOR of ENTIRE ROW as per font
>> color of a particular cell in that row. Sample file attached.
>>
>> Pls help me here.
>>
>> Regards
>>
>> Amit
>>
>>  --
>> FORUM RULES (986+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
>> ------------------------------------------------------------------------------------------------------
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> To unsubscribe, send a blank email to
>> excel-macros+unsubscr...@googlegroups.com
>
>
>
>
>
>
>
>  --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>
> To unsubscribe, send a blank email to
> excel-macros+unsubscr...@googlegroups.com
>

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com

Reply via email to