try this code-

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim abc As Range
If Target.Column = 19 Then
Set abc = Range("s" & Target.Row & ":s" & Target.Row + Target.Rows.Count)


For Each cell In abc
Select Case cell.Value
Case "A"
cell.EntireRow.Interior.Color = RGB(192, 192, 192)
Case "B"
cell.EntireRow.Interior.Color = RGB(0, 0, 255)
Case "C"
cell.EntireRow.Interior.Color = RGB(255, 255, 0)
Case Else
cell.EntireRow.Interior.Color = xlNone
End Select
Next cell
End If
End Sub



On Mon, Jul 4, 2011 at 9:44 PM, Ahmed galal <ahmed.ga...@live.com> wrote:

>  I'll explain what the problem:-
> try to pull + for cell to auto fill code like "A" into 3 cells down it will
> return error, also if u select more than one cell including codes and delete
> selection contents it returns error also.
>
>
> Date: Mon, 4 Jul 2011 21:27:49 +0530
> Subject: Re: $$Excel-Macros$$ How Can I Clear Content & Autofill
> From: koul.ash...@gmail.com
> To: excel-macros@googlegroups.com
>
>
> try this see if it helps
>
>  Private Sub Worksheet_Change(ByVal Target As Range)
>
> If Target.Column = 19 And Target.Count = 1 Then
>
> Select Case Target.Value
> Case "A"
> Target.EntireRow.Interior.Color = RGB(192, 192, 192)
>
> Case "B"
> Target.EntireRow.Interior.Color = RGB(0, 0, 255)
>
> Case "C"
> Target.EntireRow.Interior.Color = RGB(255, 255, 0)
> Case Else
>
> Target.EntireRow.Interior.Color = xlNone
> End Select
> End If
> End Sub
>
>
> On Mon, Jul 4, 2011 at 7:51 PM, Ahmed galal <ahmed.ga...@live.com> wrote:
>
>  *Hi all*
> I choose a specific Column Such as X Column and when one cell change it's
> return a value in another cell in another column.
> now i need to make Auto-fill or Clear Content to act on all row content,
> plz see the attachment
>
>
> Best regards,
>
>
>
> *Ahmed galal Mohamed*
>
> Procurement Engineer
>
> Head Office : SQUARE Engineering Firm
> Tel       :(202) 2402 8846
> Fax      :(202) 2405 0476
> Mobile :(010) 9 62 60 61
> Website : http://www.square.com.eg
> 31 Lebanon St. Mohandsen, Giza, Egypt
>
>
>
>
> --
>
> ----------------------------------------------------------------------------------
> 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
>
>
>
>
> --
> *Regards*
> * *
> *Ashish Koul*
> *akoul*.*blogspot*.com <http://akoul.blogspot.com/>
> http://akoul.posterous.com/
> *akoul*.wordpress.com <http://akoul.wordpress.com/>
> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830>
>
>
> P Before printing, think about the environment.
>
>
>
> --
>
> ----------------------------------------------------------------------------------
> 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
>



-- 
*Regards*
* *
*Ashish Koul*
*akoul*.*blogspot*.com <http://akoul.blogspot.com/>
http://akoul.posterous.com/
*akoul*.wordpress.com <http://akoul.wordpress.com/>
My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830>


P Before printing, think about the environment.

-- 
----------------------------------------------------------------------------------
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