LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing cells within a column based on cell fill color Jim D. New Users to Excel 2 October 8th 08 04:56 PM
My fill color and font color do not work in Excel Std Edition 2003 chapstick Excel Discussion (Misc queries) 1 September 11th 05 08:48 PM
EXCEL MACRO - fill column with color tpk1031 Excel Programming 2 September 17th 04 06:44 AM
Find first and last cells in column that have a certain fill color Ashleigh K. Excel Programming 1 December 11th 03 03:54 PM
Find first and last cells in column that have a certain fill color Ashleigh K. Excel Programming 0 December 11th 03 03:41 PM


All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"