Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 222
Default Insert Row colors the complete Row


I use the following code to highlight the last entry in a row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells. _
Interior.ColorIndex = xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Problem is, when a Row is inserted, the complete row is Yellow. I have no
Conditional Formating in use.

All I can figure is, it must be in the code.

Bob

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Insert Row colors the complete Row

Bob,

This should cure the colour the entire row bit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =
xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Mike

"robert morris" wrote:


I use the following code to highlight the last entry in a row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells. _
Interior.ColorIndex = xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Problem is, when a Row is inserted, the complete row is Yellow. I have no
Conditional Formating in use.

All I can figure is, it must be in the code.

Bob

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 222
Default Insert Row colors the complete Row

Mike,

Thanks, it get rid of the entire row bit but, I get an error box which says;
Compile Error
Syntax Error

And the line below is highlighted in the code, and it no longer highlights
the last entry anywhere on the sheet.

Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =

Bob


"Mike H" wrote:

Bob,

This should cure the colour the entire row bit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =
xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Mike

"robert morris" wrote:


I use the following code to highlight the last entry in a row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells. _
Interior.ColorIndex = xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Problem is, when a Row is inserted, the complete row is Yellow. I have no
Conditional Formating in use.

All I can figure is, it must be in the code.

Bob

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Insert Row colors the complete Row

Bob,

That's just line wrap, the 2 line below should be one but have wrapped in
the post

Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =
xlColorIndexNone

Mike

"robert morris" wrote:

Mike,

Thanks, it get rid of the entire row bit but, I get an error box which says;
Compile Error
Syntax Error

And the line below is highlighted in the code, and it no longer highlights
the last entry anywhere on the sheet.

Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =

Bob


"Mike H" wrote:

Bob,

This should cure the colour the entire row bit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =
xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Mike

"robert morris" wrote:


I use the following code to highlight the last entry in a row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells. _
Interior.ColorIndex = xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Problem is, when a Row is inserted, the complete row is Yellow. I have no
Conditional Formating in use.

All I can figure is, it must be in the code.

Bob

  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Insert Row colors the complete Row

NG word wrap. The bit on the next line should be part of that line.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"robert morris" wrote in message
...
Mike,

Thanks, it get rid of the entire row bit but, I get an error box which
says;
Compile Error
Syntax Error

And the line below is highlighted in the code, and it no longer highlights
the last entry anywhere on the sheet.

Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =

Bob


"Mike H" wrote:

Bob,

This should cure the colour the entire row bit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex
=
xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Mike

"robert morris" wrote:


I use the following code to highlight the last entry in a row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells. _
Interior.ColorIndex = xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Problem is, when a Row is inserted, the complete row is Yellow. I have
no
Conditional Formating in use.

All I can figure is, it must be in the code.

Bob



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 222
Default Insert Row colors the complete Row

Mike,

I corrected the wrap and all is well. Thanks a million/billion!

Bob


"Mike H" wrote:

Bob,

That's just line wrap, the 2 line below should be one but have wrapped in
the post

Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =
xlColorIndexNone

Mike

"robert morris" wrote:

Mike,

Thanks, it get rid of the entire row bit but, I get an error box which says;
Compile Error
Syntax Error

And the line below is highlighted in the code, and it no longer highlights
the last entry anywhere on the sheet.

Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =

Bob


"Mike H" wrote:

Bob,

This should cure the colour the entire row bit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells.Interior.ColorIndex =
xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Mike

"robert morris" wrote:


I use the following code to highlight the last entry in a row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
Range("F" & Target.Row & ":Y" & Target.Row).Cells. _
Interior.ColorIndex = xlColorIndexNone
Target.Cells.Interior.Color = vbYellow
End If
End Sub

Problem is, when a Row is inserted, the complete row is Yellow. I have no
Conditional Formating in use.

All I can figure is, it must be in the code.

Bob

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
2007 Colors - I want 2003 Colors Austin22 Excel Discussion (Misc queries) 0 October 16th 07 02:49 PM
Lost highlighting and font colors; background colors on web pages Jan in Raleigh Excel Discussion (Misc queries) 2 July 31st 07 09:10 PM
Can't format font colors or cell fill-in colors canoeron Excel Discussion (Misc queries) 3 August 22nd 05 11:46 PM
Insert Colors seting for Excel header & footer files. poorya shidfar Setting up and Configuration of Excel 0 August 15th 05 01:33 PM
Formulas (If linked data is not null, then insert "Complete" in ce Task Lead Nicole Excel Worksheet Functions 3 January 10th 05 06:25 PM


All times are GMT +1. The time now is 12:35 PM.

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

About Us

"It's about Microsoft Excel"