Use Conditional Formatting formula =
=$A2+1>=COLUMN()
set patterns to color desired>OK>and copy format
Or 
Simple, just change from drawing a line to coloring the cells. Works when you 
change the cell.
You MUST save the file as an xlsM file for macros and enable macros.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim tr As Long
tr = Target.Row
Rows(tr).Interior.ColorIndex = xlNone
If Target.Column < 1 Or Not IsNumeric(Target) Or _
Len(Application.Trim(Target)) < 1 Then Exit Sub
Range(Cells(tr, 2), Cells(tr, Target + 1)) _
.Interior.ColorIndex = 6
End Sub

From: ICWAI Help 
Sent: Tuesday, August 16, 2011 4:04 PM
To: excel-macros@googlegroups.com 
Subject: Re: $$Excel-Macros$$ UDF Function for conditoin formetting

Please find the attached file and give me the solution :) 
if the perticuler cell value is 4 then next 4 coloumn cells in same row shoudl 
be highleted .


On Tue, Aug 16, 2011 at 11:42 PM, dguillett1 <dguille...@gmail.com> wrote:

  I did this VERY recently in another formum. Was it you?
  Right click sheet tab>view code>insert this

  Private Sub Worksheet_Change(ByVal Target As Range)
  Dim tr As Long
  tr = Target.Row
  Rows(tr).Borders(xlEdgeBottom).LineStyle = xlNone
  If Target.Column <> 1 Or Not IsNumeric(Target) Or _
  Len(Application.Trim(Target)) < 1 Then Exit Sub
  Range(Cells(tr, 2), Cells(tr, Target + 1)) _
  .Borders(xlEdgeBottom).LineStyle = xlContinuous
  End Sub

  From: ICWAI Help 
  Sent: Tuesday, August 16, 2011 11:02 AM
  To: excel-macros@googlegroups.com 
  Subject: $$Excel-Macros$$ UDF Function for conditoin formetting

  Please provide me UDF functino for below requirement 

  example:)

  if the cell value is 4 then including active cell next 4 cell in a row should 
be higleted with color.
  ex
  if 
  a1 is 4 then a1 ,b1 ,c 1, d 1, f 1 should be higleted.

  Thansk,
  Rakesh. 
  -- 
  
----------------------------------------------------------------------------------
  Some important links for excel users:
  1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
  2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
  3. Excel tutorials at http://www.excel-macros.blogspot.com
  4. Learn VBA Macros at http://www.quickvba.blogspot.com
  5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

  To post to this group, send email to excel-macros@googlegroups.com
   
  <><><><><><><><><><><><><><><><><><><><><><>
  Like our page on facebook , Just follow below link
  http://www.facebook.com/discussexcel

  -- 
  
----------------------------------------------------------------------------------
  Some important links for excel users:
  1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
  2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
  3. Excel tutorials at http://www.excel-macros.blogspot.com
  4. Learn VBA Macros at http://www.quickvba.blogspot.com
  5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

  To post to this group, send email to excel-macros@googlegroups.com
   
  <><><><><><><><><><><><><><><><><><><><><><>
  Like our page on facebook , Just follow below link
  http://www.facebook.com/discussexcel


-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com
 
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to