LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Setting values by row color

Thanks Bob,

That works fine I will have to iterate through the rows though because the
event type doesn't quite suit the way the sheet will be used.


Regards,
Ron.

"Bob Phillips" wrote:


Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Interior.ColorIndex
Case 3: .Value = "Bill" 'red
Case 6: .Value = "John" 'yellow
Case 5: .Value = "Ron" 'blue
Case 10: .Value = "Alan" 'green
'etc.
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ron" wrote in message
...
Hi,

I need to set the values (Peoples names) of a column according to the fill
color of each row.

Can anyone please point me in the right direction with this problem.

I'm a VBA newbie by the way!


Regards,
Ron.




 
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
Setting Wall Color in 3-D charts Marian Charts and Charting in Excel 1 August 26th 09 01:46 AM
Reading a color, and setting a value Mark from Princeton Excel Programming 6 September 22nd 05 07:31 PM
Automatic color setting in Excel Bogeyfre Excel Discussion (Misc queries) 4 June 12th 05 06:43 PM
Setting Color of PIE sections Vishesh Vyas Charts and Charting in Excel 2 May 5th 05 10:15 AM
setting cell color Wazooli Excel Worksheet Functions 9 January 19th 05 02:21 AM


All times are GMT +1. The time now is 09:35 PM.

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

About Us

"It's about Microsoft Excel"