Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi there
Is there a macro that highlights the whole active row (not only the active cell) that the cursor is in, in an Excel worksheet? Thanks Raj |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Highlight it in a particular colour, I meant... that would move along when I
would move the cursor onto another row.... "Raj Mazumdar" wrote: Hi there Is there a macro that highlights the whole active row (not only the active cell) that the cursor is in, in an Excel worksheet? Thanks Raj |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this
'---------------------------------------------------------------- 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 Phillips (remove nothere from email address if mailing direct) "Raj Mazumdar" wrote in message ... Highlight it in a particular colour, I meant... that would move along when I would move the cursor onto another row.... "Raj Mazumdar" wrote: Hi there Is there a macro that highlights the whole active row (not only the active cell) that the cursor is in, in an Excel worksheet? Thanks Raj |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Perfect, Bob... the colour is a very soothing one too... thanks a tonne.
There isn't a way to do just the row, eh? Never mind if there isn't... this one'll work pretty well for me too... Thanks a bunch again... Have a great one. Raj "Bob Phillips" wrote: Try this '---------------------------------------------------------------- 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 Phillips (remove nothere from email address if mailing direct) "Raj Mazumdar" wrote in message ... Highlight it in a particular colour, I meant... that would move along when I would move the cursor onto another row.... "Raj Mazumdar" wrote: Hi there Is there a macro that highlights the whole active row (not only the active cell) that the cursor is in, in an Excel worksheet? Thanks Raj |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Raj,
You know the answer is alwasy yes <vbg Option Explicit '---------------------------------------------------------------- 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 .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.ColorIndex = 36 End With End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Raj Mazumdar" wrote in message ... Perfect, Bob... the colour is a very soothing one too... thanks a tonne. There isn't a way to do just the row, eh? Never mind if there isn't... this one'll work pretty well for me too... Thanks a bunch again... Have a great one. Raj "Bob Phillips" wrote: Try this '---------------------------------------------------------------- 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 Phillips (remove nothere from email address if mailing direct) "Raj Mazumdar" wrote in message ... Highlight it in a particular colour, I meant... that would move along when I would move the cursor onto another row.... "Raj Mazumdar" wrote: Hi there Is there a macro that highlights the whole active row (not only the active cell) that the cursor is in, in an Excel worksheet? Thanks Raj |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Perfecto! Thanks Bob... you guys are the best...
"Bob Phillips" wrote: Hi Raj, You know the answer is alwasy yes <vbg Option Explicit '---------------------------------------------------------------- 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 .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" .FormatConditions(1).Interior.ColorIndex = 36 End With End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Raj Mazumdar" wrote in message ... Perfect, Bob... the colour is a very soothing one too... thanks a tonne. There isn't a way to do just the row, eh? Never mind if there isn't... this one'll work pretty well for me too... Thanks a bunch again... Have a great one. Raj "Bob Phillips" wrote: Try this '---------------------------------------------------------------- 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 Phillips (remove nothere from email address if mailing direct) "Raj Mazumdar" wrote in message ... Highlight it in a particular colour, I meant... that would move along when I would move the cursor onto another row.... "Raj Mazumdar" wrote: Hi there Is there a macro that highlights the whole active row (not only the active cell) that the cursor is in, in an Excel worksheet? Thanks Raj |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. | Excel Discussion (Misc queries) | |||
No Colour On Drawing In Excel | Setting up and Configuration of Excel | |||
Problems with Colour Printing | Excel Discussion (Misc queries) | |||
Text in Blue colour, but print in black colour | Excel Worksheet Functions | |||
Function to return colour of formatted cell | Excel Worksheet Functions |