View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tpk1031[_2_] tpk1031[_2_] is offline
external usenet poster
 
Posts: 1
Default Fill column with color


guyz..recently .. i posted a column coloring question.....

i did it...thanx... it works

but ...the function loops many times..... that i dont even know ho
much times it loops...

here is what i did..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)


'x = Target.Row
'Target.Text = UCase(Target.Text)
Dim str As String


If Target.Column = 5 Then
str = UCase(Target.Text)

If str = "M" Or str = "m" Or str = "Merah" Or str = "MERAH" Then

Target.Cells(1, 2).Interior.Color = 0
Target.Cells(1, 2).Interior.ColorIndex = 3 're
color
Target.Value = "Merah"
Exit Sub

ElseIf str = "K" Or str = "k" Or str = "KUNING" Or str = "Kuning
Then

Target.Cells(1, 2).Interior.Color = 0

Target.Cells(1, 2).Interior.ColorIndex = 6 ' yello
color
Target.Value = "Kuning"
Exit Sub

ElseIf str = "B" Or str = "b" Or str = "Biru" Or str = "BIRU" Then


Target.Cells(1, 2).Interior.Color = 0

Target.Cells(1, 2).Interior.ColorIndex = 5 'blu
color
Target.Value = "Biru"
Exit Sub

ElseIf str = "H" Or str = "h" Or str = "Hijau" Or str = "HIJAU
Then

Target.Cells(1, 2).Interior.Color = 0

Target.Cells(1, 2).Interior.ColorIndex = 4 'gree
color
Target.Value = "Hijau"
Exit Sub
End If

Else
Exit Sub
End If

End Sub


guyz...pls help me.... keep looping really waste a lot of time...

--
tpk103
-----------------------------------------------------------------------
tpk1031's Profile: http://www.excelforum.com/member.php...fo&userid=1446
View this thread: http://www.excelforum.com/showthread.php?threadid=26151