Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Highlight Cells in Active Row

Hi,

Can anyone tell me how to highlight cells in column A & B of the
active row, I wish this to be a Workbook command if possible.

Thanks

Peter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Highlight Cells in Active Row

"Pete" wrote in message
...
Hi,

Can anyone tell me how to highlight cells in column A & B of the
active row, I wish this to be a Workbook command if possible.



I used the macro recorder to get trhis:

Range("A4:B4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With

I'd suggest that you use the macro recorder to discover what values give
you the highlight you want.

Then, I'd replace

Range("A4:B4").Select
With Selection.Interior

with

With ActiveCell.EntireRow.Columns("A:B").Interior

to highlight columns A and B of the active row.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Highlight Cells in Active Row

Right click sheet tabview codepaste this. Now when you select a row
it will highlight col a & b of that row

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
'With Target.EntireRow
With Cells(Target.Row, 1).Resize(, 2)
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 6 '35
End With
End Sub



On Jun 8, 1:00*pm, Pete wrote:
Hi,

Can anyone tell me how to highlight cells in column A & B of the
active row, I wish this to be a Workbook command if possible.

Thanks

Peter


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Highlight Cells in Active Row

On Jun 8, 11:23*pm, Don Guillett wrote:
Right click sheet tabview codepaste this. Now when you select a row
it will highlight col a & b of that row

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
* * Cells.FormatConditions.Delete
* * * * * *'With Target.EntireRow
* * With Cells(Target.Row, 1).Resize(, 2)
* * * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * * .FormatConditions(1).Interior.ColorIndex = 6 * * *'35
* * End With
End Sub

On Jun 8, 1:00*pm, Pete wrote:



Hi,


Can anyone tell me how to highlight cells in column A & B of the
active row, I wish this to be a Workbook command if possible.


Thanks


Peter- Hide quoted text -


- Show quoted text -


Can this be adapted to work with the Workbook_SelectionChange Sub?

Thanks in advance

Peter
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Highlight Cells in Active Row

On Jun 10, 2:51*pm, Pete wrote:
On Jun 8, 11:23*pm, Don Guillett wrote:





Right click sheet tabview codepaste this. Now when you select a row
it will highlight col a & b of that row


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
* * Cells.FormatConditions.Delete
* * * * * *'With Target.EntireRow
* * With Cells(Target.Row, 1).Resize(, 2)
* * * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * * .FormatConditions(1).Interior.ColorIndex = 6 * * *'35
* * End With
End Sub


On Jun 8, 1:00*pm, Pete wrote:


Hi,


Can anyone tell me how to highlight cells in column A & B of the
active row, I wish this to be a Workbook command if possible.


Thanks


Peter- Hide quoted text -


- Show quoted text -


Can this be adapted to work with the Workbook_SelectionChange Sub?

Thanks in advance

Peter- Hide quoted text -

- Show quoted text -



Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)
Cells.FormatConditions.Delete
'With Target.EntireRow
With Cells(Target.Row, 1).Resize(, 2)
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 6 '35
End With

End Sub


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Highlight Cells in Active Row

On Jun 10, 11:28*pm, Don Guillett wrote:
On Jun 10, 2:51*pm, Pete wrote:





On Jun 8, 11:23*pm, Don Guillett wrote:


Right click sheet tabview codepaste this. Now when you select a row
it will highlight col a & b of that row


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
* * Cells.FormatConditions.Delete
* * * * * *'With Target.EntireRow
* * With Cells(Target.Row, 1).Resize(, 2)
* * * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * * .FormatConditions(1).Interior.ColorIndex = 6 * * *'35
* * End With
End Sub


On Jun 8, 1:00*pm, Pete wrote:


Hi,


Can anyone tell me how to highlight cells in column A & B of the
active row, I wish this to be a Workbook command if possible.


Thanks


Peter- Hide quoted text -


- Show quoted text -


Can this be adapted to work with the Workbook_SelectionChange Sub?


Thanks in advance


Peter- Hide quoted text -


- Show quoted text -


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)
* Cells.FormatConditions.Delete
* * * * * *'With Target.EntireRow
* * With Cells(Target.Row, 1).Resize(, 2)
* * * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * * .FormatConditions(1).Interior.ColorIndex = 6 * * *'35
* * End With

End Sub- Hide quoted text -

- Show quoted text -


Don, this is what I want, which is to highlight Column A & B of the
Active Row however I already have conditional formatting applied with
Condition 1 & 2, could you amend so that this Sub allows me to retain
what I have and still highlight column A & B as you have done?

Thanks in advance,
Reply
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
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
highlight row of active cell pswanie Excel Programming 6 August 19th 09 09:26 PM
Trying to highlight cells that have the same value as the active c Excel_Rookie Excel Worksheet Functions 9 June 12th 09 02:45 AM
Highlight the cells referenced in the active cell formula Charles Excel Programming 2 June 21st 07 04:30 AM
change highlight color on active cells Louis New Users to Excel 1 November 22nd 05 08:43 PM


All times are GMT +1. The time now is 10:46 AM.

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

About Us

"It's about Microsoft Excel"