• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Conditional Formatting

sachindchaudhari

New Member
need to have same format (specially Color) of A1 to B1,C1,D1 as on..

please help..


in short need to highlight complete row if a cell is highlighted..
 
Hi ,


Will the base cell ( which is highlighted , and whose color needs to be used in all the remaining cells of that row ) , be the same ? Will say row 1 have cell A1 highlighted , while row 2 may have cell D2 highlighted and so on ?


Narayan
 
A1 (will be highlighted as per condition). if A1 highlighted, the the entire row (B1,C1,D1......)should be highlighted with color of A1...

Next Row

A2 (will be highlighted as per condition). if A2 highlighted, the the entire row (B2,C2,D2......)should be highlighted with color of A2...


LIKE THAT...
 
Hi ,


You can try the following code :

[pre]
Code:
Public Sub Colour_Entire_Row()
Application.ScreenUpdating = False
uncoloured = RGB(255, 255, 255)        '  this is the code for an uncoloured cell
ThisWorkbook.Sheets("Sheet2").Activate '  change this to whatever sheet you want this code to act on
ActiveSheet.UsedRange.Select
Number_of_Rows = Selection.Rows.Count
Number_of_Columns = Selection.Columns.Count
For i = 1 To Number_of_Rows
colour_format = ActiveCell.Offset(i - 1, 0).Interior.Color
If colour_format <> uncoloured Then
Range(ActiveCell.Offset(i - 1, 1), ActiveCell.Offset(i - 1, Number_of_Columns - 1)).Interior.Color = colour_format
End If
Next
Application.ScreenUpdating = True
End Sub
[/pre]

Narayan
 
Back
Top