I am sorry, but I don't understand what you mean. Please try again.

On Oct 24, 5:08 am, Bajji <sridhar.bo...@gmail.com> wrote:
> Hi Rolf,
> I need similar help, little different way
>
> When I run the Macro, user form should pop up allowing to put the
> array (a1: j10) details to color the rows
>
> Regards,
> Sri
>
> On Oct 24, 4:53 am, RolfJ <r...@pacificsound.us> wrote:
>
>
>
> > I can't figure a way to do this by way of conditional formating, but I
> > can offer some VBA code that would do the trick. Place the following
> > code into the a standard VBA module of your workbook:
>
> > Public Sub ColorTable()
> >     Dim rRow As Range
> >     For Each rRow In ActiveSheet.UsedRange.Rows
> >         If rRow.Row >= 4 Then
> >             Select Case rRow.Cells(1, "M").Value
> >                 Case "Green"
> >                     Call ColorCells(rRow.Row, vbGreen)
> >                 Case "Orange"
> >                     Call ColorCells(rRow.Row, RGB(255, 140, 0))
> >                 Case "Red"
> >                     Call ColorCells(rRow.Row, vbRed)
> >             End Select
> >         End If
> >     Next rRow
> > End Sub
>
> > Public Sub ColorCells(iRow As Long, c As Long)
> >     Dim r As Range
> >     Set r = Rows(iRow)
> >     Dim col As Integer
> >     For col = Asc("A") To Asc("L")
> >         r.Cells(1, Chr(col)).Interior.Color = c
> >     Next col
> > End Sub
>
> > Place the following code into the VBA module associated with the
> > worksheet containing the table:
>
> > Private Sub Worksheet_Change(ByVal Target As Range)
> >     If Target.Column <> Columns("M").Column Then Exit Sub
> >     Select Case Target.Value
> >         Case "Green"
> >             Call ColorCells(Target.Row, vbGreen)
> >         Case "Orange"
> >             Call ColorCells(Target.Row, RGB(255, 140, 0))
> >         Case "Red"
> >             Call ColorCells(Target.Row, vbRed)
> >     End Select
> > End Sub
>
> > And finally place this code into the ThisWorkbook VBA module:
>
> > Private Sub Workbook_Open()
> >     ColorTable
> > End Sub
>
> > That should do it.
>
> > Hope this helped,
> > Rolf
>
> > On Oct 22, 10:18 pm, ASHUTOSH AGARWAL <ca.ashut...@gmail.com> wrote:
>
> > > Dear All,
>
> > > In the attached file, I want to format cells (a4 to l14) in a manner
> > > where row colour would be same as appearing in coloumn M.  In other
> > > words, in row number 5, I want cells from A to L to be fileld in Green
> > > color, in row 6 in red color, etc.
>
> > > Is it possible to do so using conditional formating?
>
> > > Thanks in advance,
> > > Ashutosh
>
> > >  Sample.xls
> > > 42KViewDownload- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to