Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I would like to highlight/shade a certain cell in whichever row I am
currently working on. For example, whenever I am anywhere on row 10 I would like cell A10 to be highlighted or shaded a certain colour, and similarly for row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or ACTIVECELL so that I can then use conditional formatting, but can't find anything. I am using EXCEL 2007. Please help. Thanks. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How about this? Be aware, it will destroy any other CF you have
'---------------------------------------------------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) '---------------------------------------------------------------- Cells.FormatConditions.Delete With Target With .EntireRow .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With With .Borders(xlBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With .Interior.ColorIndex = 20 End With End With With .EntireColumn .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With With .Borders(xlRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With .Interior.ColorIndex = 20 End With End With .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.ColorIndex = 36 End With 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) "Staanley" wrote in message ... I would like to highlight/shade a certain cell in whichever row I am currently working on. For example, whenever I am anywhere on row 10 I would like cell A10 to be highlighted or shaded a certain colour, and similarly for row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or ACTIVECELL so that I can then use conditional formatting, but can't find anything. I am using EXCEL 2007. Please help. Thanks. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Have a look here
http://www.cpearson.com/excel/RowLiner.htm Mike "Staanley" wrote: I would like to highlight/shade a certain cell in whichever row I am currently working on. For example, whenever I am anywhere on row 10 I would like cell A10 to be highlighted or shaded a certain colour, and similarly for row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or ACTIVECELL so that I can then use conditional formatting, but can't find anything. I am using EXCEL 2007. Please help. Thanks. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Bob,
Thanks very much. The problem I have is that the worksheet is quite heavily formatted and I guess this would destroy that. I would say I am a fairly competent EXCEL user, but am not an expert, so I hope I have not misunderstood you. Cheers, Ian. "Bob Phillips" wrote: How about this? Be aware, it will destroy any other CF you have '---------------------------------------------------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) '---------------------------------------------------------------- Cells.FormatConditions.Delete With Target With .EntireRow .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With With .Borders(xlBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With .Interior.ColorIndex = 20 End With End With With .EntireColumn .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With With .Borders(xlRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With .Interior.ColorIndex = 20 End With End With .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.ColorIndex = 36 End With 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) "Staanley" wrote in message ... I would like to highlight/shade a certain cell in whichever row I am currently working on. For example, whenever I am anywhere on row 10 I would like cell A10 to be highlighted or shaded a certain colour, and similarly for row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or ACTIVECELL so that I can then use conditional formatting, but can't find anything. I am using EXCEL 2007. Please help. Thanks. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It won't destroy formatting, other than any conditional formatting It does
destroy that I am afraid. -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Staanley" wrote in message ... Bob, Thanks very much. The problem I have is that the worksheet is quite heavily formatted and I guess this would destroy that. I would say I am a fairly competent EXCEL user, but am not an expert, so I hope I have not misunderstood you. Cheers, Ian. "Bob Phillips" wrote: How about this? Be aware, it will destroy any other CF you have '---------------------------------------------------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) '---------------------------------------------------------------- Cells.FormatConditions.Delete With Target With .EntireRow .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With With .Borders(xlBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With .Interior.ColorIndex = 20 End With End With With .EntireColumn .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With With .Borders(xlRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 5 End With .Interior.ColorIndex = 20 End With End With .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.ColorIndex = 36 End With 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) "Staanley" wrote in message ... I would like to highlight/shade a certain cell in whichever row I am currently working on. For example, whenever I am anywhere on row 10 I would like cell A10 to be highlighted or shaded a certain colour, and similarly for row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or ACTIVECELL so that I can then use conditional formatting, but can't find anything. I am using EXCEL 2007. Please help. Thanks. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Mike,
Thanks very much - this is excellent. Cheers, Ian. "Mike H" wrote: Have a look here http://www.cpearson.com/excel/RowLiner.htm Mike "Staanley" wrote: I would like to highlight/shade a certain cell in whichever row I am currently working on. For example, whenever I am anywhere on row 10 I would like cell A10 to be highlighted or shaded a certain colour, and similarly for row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or ACTIVECELL so that I can then use conditional formatting, but can't find anything. I am using EXCEL 2007. Please help. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Identify if a cell contains a numerical string | Excel Worksheet Functions | |||
Identify the cell with Max & Min values | Excel Worksheet Functions | |||
Identify current active cell | Excel Worksheet Functions | |||
How to identify a cell without a formula | Excel Discussion (Misc queries) | |||
Identify if a cell is referenced by other cells | Excel Worksheet Functions |