Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello there,
Please help. I have coloured the cells in Rows A1:E1 blue. Using a macro, I would like Excel to check each value in the above row and colour the corresponding digit value blue in the range A5:E5. (I have used up all 3 Conditional Format options, hence the need to use macros for further cell formatting). Thanx -- KCG |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Here is an example that changes the colour as the value is entered
'----------------------------------------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) '----------------------------------------------------------------- Const WS_RANGE As String = "A5:E5" '<=== change to suit On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Select Case .Value Case 1: .Offset(-1,0).Interior.ColorIndex = 3 'red Case 2: .Offset(-1,0).Interior.ColorIndex = 6 'yellow Case 3: .Offset(-1,0).Interior.ColorIndex = 5 'blue Case 4: .Offset(-1,0).Interior.ColorIndex = 10 'green Case 5: .Offset(-1,0).Interior.ColorIndex = 38 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 Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "KCG" wrote in message ... Hello there, Please help. I have coloured the cells in Rows A1:E1 blue. Using a macro, I would like Excel to check each value in the above row and colour the corresponding digit value blue in the range A5:E5. (I have used up all 3 Conditional Format options, hence the need to use macros for further cell formatting). Thanx -- KCG |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert 2 digit month to 4 digit years and months | Excel Worksheet Functions | |||
Color a single digit in a mult-digit number cell | Excel Discussion (Misc queries) | |||
How do I identify the 7th digit in a 13 digit number, then establi | Excel Worksheet Functions | |||
Tell users how to sort 5 digit and 9 digit zipcodes correctly aft. | New Users to Excel | |||
When we enter a 16 digit number (credit card) the last digit chan. | Excel Discussion (Misc queries) |