Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi guys,
I want to create a Macro which styles the cell selected by the user and the 10 adjacent cells on the same row green. I'm a bit confused as what to set the range as, the cell selected will always be in C and I want it highlighted up to M of the selected row only. Range("XXX").Select Selection.Style = "Good" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Alan,
Am Tue, 11 Jun 2013 14:56:33 +0100 schrieb AlanJCarr: I want to create a Macro which styles the cell selected by the user and the 10 adjacent cells on the same row green. I'm a bit confused as what to set the range as, the cell selected will always be in C and I want it highlighted up to M of the selected row only. put the code into the code module of the expected sheet: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Intersect(Target, Columns("C")) Is _ Nothing Then Exit Sub With ActiveSheet .UsedRange.Interior.ColorIndex = 0 End With Target.Resize(, 11).Interior.ColorIndex = 4 End Sub Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tuesday, June 11, 2013 9:56:33 AM UTC-4, AlanJCarr wrote:
Hi guys, I want to create a Macro which styles the cell selected by the user and the 10 adjacent cells on the same row green. I'm a bit confused as what to set the range as, the cell selected will always be in C and I want it highlighted up to M of the selected row only. Range("XXX").Select Selection.Style = "Good" -- AlanJCarr Al, per chance, were/are you from Northern Ohio? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2B or not 2B? - Go to cell Bx, depending on what row is selected | Excel Programming | |||
Applying Indian comma style | Excel Discussion (Misc queries) | |||
Applying style to row, getting Run-time error '450' | Excel Programming | |||
Want add color to the cell depending on the value selected from th | Excel Programming | |||
applying function depending on condition in other cell | Excel Programming |