Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Macro needed to highlight a row

I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . How do
I do a macro to perform this? I would like each type to be a
different color such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Macro needed to highlight a row

Have you considered using a conditional format to do this? I also presume
that Missing/Paid Off/Other are all entered in the same column? If so, you
could set a condition for values on that column to change the entire row.

Come back if you need more help.
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Maggie" wrote:

I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . How do
I do a macro to perform this? I would like each type to be a
different color such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Macro needed to highlight a row

On Jan 28, 2:43*pm, Barb Reinhardt
wrote:
Have you considered using a conditional format to do this? * *I also presume
that Missing/Paid Off/Other are all entered in the same column? *If so, you
could set a condition for values on that column to change the entire row. *

Come back if you need more help.
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Maggie" wrote:
I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . *How do
I do a macro to perform this? *I would like each type to be a
different color *such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help- Hide quoted text -


- Show quoted text -


I have tried conditional formatting but it will only highlight the
cell. The data entered is in three different columns.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Macro needed to highlight a row

On Jan 28, 2:49*pm, Maggie wrote:
On Jan 28, 2:43*pm, Barb Reinhardt





wrote:
Have you considered using a conditional format to do this? * *I also presume
that Missing/Paid Off/Other are all entered in the same column? *If so, you
could set a condition for values on that column to change the entire row. *


Come back if you need more help.
--
HTH,
Barb Reinhardt


If this post was helpful to you, please click YES below.


"Maggie" wrote:
I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . *How do
I do a macro to perform this? *I would like each type to be a
different color *such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help- Hide quoted text -


- Show quoted text -


I have tried conditional formatting but it will only highlight the
cell. *The data entered is in three different columns.- Hide quoted text -

- Show quoted text -


And the data is coming from a drop down.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Macro needed to highlight a row

On 28 jan, 20:28, Maggie wrote:
I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . *How do
I do a macro to perform this? *I would like each type to be a
different color *such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help


Hai Maggie,

For starters VBA has 8 shorthand colors
vbBlack
vbRed
vbGreen
vbYellow
vbBlue
vbMagenta
vbCyan
vbWhite

Next to this you can use a colorindex.

To come back to your question:
Copy the macro below into the macropar of the sheet where you want the
colorchanging occur

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Value
Case "Paid off": Target.EntireRow.Interior.Color = vbYellow
Case "Missing": Target.EntireRow.Interior.Color = vbRed
Case "Other": Target.EntireRow.Interior.Color = vbMagenta
End Select
End Sub


HTH,
Wouter


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Macro needed to highlight a row

On Jan 28, 2:56*pm, RadarEye wrote:
On 28 jan, 20:28, Maggie wrote:

I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . *How do
I do a macro to perform this? *I would like each type to be a
different color *such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help


Hai Maggie,

For starters VBA has 8 shorthand colors
vbBlack
vbRed
vbGreen
vbYellow
vbBlue
vbMagenta
vbCyan
vbWhite

Next to this you can use a colorindex.

To come back to your question:
Copy the macro below into the macropar of the sheet where you want the
colorchanging occur

Private Sub Worksheet_Change(ByVal Target As Range)
* * Select Case Target.Value
* * * * Case "Paid off": Target.EntireRow.Interior.Color = vbYellow
* * * * Case "Missing": *Target.EntireRow.Interior.Color = vbRed
* * * * Case "Other": * *Target.EntireRow.Interior.Color = vbMagenta
* * End Select
End Sub

HTH,
Wouter


Thanks, that worked perfect, but if I accidently put in Paid Off I
have to manually change the fill is there a way when I delete the
entry, it will put the fill back to original?
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Macro needed to highlight a row

On Jan 28, 3:20*pm, Maggie wrote:
On Jan 28, 2:56*pm, RadarEye wrote:





On 28 jan, 20:28, Maggie wrote:


I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . *How do
I do a macro to perform this? *I would like each type to be a
different color *such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help


Hai Maggie,


For starters VBA has 8 shorthand colors
vbBlack
vbRed
vbGreen
vbYellow
vbBlue
vbMagenta
vbCyan
vbWhite


Next to this you can use a colorindex.


To come back to your question:
Copy the macro below into the macropar of the sheet where you want the
colorchanging occur


Private Sub Worksheet_Change(ByVal Target As Range)
* * Select Case Target.Value
* * * * Case "Paid off": Target.EntireRow.Interior.Color = vbYellow
* * * * Case "Missing": *Target.EntireRow.Interior.Color = vbRed
* * * * Case "Other": * *Target.EntireRow.Interior.Color = vbMagenta
* * End Select
End Sub


HTH,
Wouter


Thanks, that worked perfect, but if I accidently put in Paid Off I
have to manually change the fill is there a way when I delete the
entry, it will put the fill back to original?- Hide quoted text -

- Show quoted text -


Now it is saying that I need to debug here :
Target.EntireRow.Interior.Color = vbYellow
Help.
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Macro needed to highlight a row

On Jan 28, 3:20*pm, Maggie wrote:
On Jan 28, 2:56*pm, RadarEye wrote:





On 28 jan, 20:28, Maggie wrote:


I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . *How do
I do a macro to perform this? *I would like each type to be a
different color *such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help


Hai Maggie,


For starters VBA has 8 shorthand colors
vbBlack
vbRed
vbGreen
vbYellow
vbBlue
vbMagenta
vbCyan
vbWhite


Next to this you can use a colorindex.


To come back to your question:
Copy the macro below into the macropar of the sheet where you want the
colorchanging occur


Private Sub Worksheet_Change(ByVal Target As Range)
* * Select Case Target.Value
* * * * Case "Paid off": Target.EntireRow.Interior.Color = vbYellow
* * * * Case "Missing": *Target.EntireRow.Interior.Color = vbRed
* * * * Case "Other": * *Target.EntireRow.Interior.Color = vbMagenta
* * End Select
End Sub


HTH,
Wouter


Thanks, that worked perfect, but if I accidently put in Paid Off I
have to manually change the fill is there a way when I delete the
entry, it will put the fill back to original?- Hide quoted text -

- Show quoted text -


I figured that it causes a debug when I protect the sheet and I need
to protect the sheet because there are formulas.
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Macro needed to highlight a row

Try this...

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Value
Case "Paid off"
Target.EntireRow.Interior.Color = vbYellow
Case "Missing"
Target.EntireRow.Interior.Color = vbRed
Case "Other"
Target.EntireRow.Interior.Color = vbMagenta
Case Else
Target.EntireRow.Interior.ColorIndex = xlColorIndexAutomatic
End Select
End Sub

Note that except for the Case Else and the code line under it, this is the
same code as RadarEye posted... I simply removed the "join multiple code
lines" symbol (the colon) and physically split the joined lines into
separate lines (which is my personal preference).

--
Rick (MVP - Excel)


"Maggie" wrote in message
...
On Jan 28, 2:56 pm, RadarEye wrote:
On 28 jan, 20:28, Maggie wrote:

I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . How do
I do a macro to perform this? I would like each type to be a
different color such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help


Hai Maggie,

For starters VBA has 8 shorthand colors
vbBlack
vbRed
vbGreen
vbYellow
vbBlue
vbMagenta
vbCyan
vbWhite

Next to this you can use a colorindex.

To come back to your question:
Copy the macro below into the macropar of the sheet where you want the
colorchanging occur

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Value
Case "Paid off": Target.EntireRow.Interior.Color = vbYellow
Case "Missing": Target.EntireRow.Interior.Color = vbRed
Case "Other": Target.EntireRow.Interior.Color = vbMagenta
End Select
End Sub

HTH,
Wouter


Thanks, that worked perfect, but if I accidently put in Paid Off I
have to manually change the fill is there a way when I delete the
entry, it will put the fill back to original?

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Macro needed to highlight a row

On Jan 28, 3:40*pm, "Rick Rothstein"
wrote:
Try this...

Private Sub Worksheet_Change(ByVal Target As Range)
* * Select Case Target.Value
* * * * Case "Paid off"
* * * * * * Target.EntireRow.Interior.Color = vbYellow
* * * * Case "Missing"
* * * * * * Target.EntireRow.Interior.Color = vbRed
* * * * Case "Other"
* * * * * * Target.EntireRow.Interior.Color = vbMagenta
* * * * Case Else
* * * * * * Target.EntireRow.Interior.ColorIndex = xlColorIndexAutomatic
* * End Select
End Sub

Note that except for the Case Else and the code line under it, this is the
same code as RadarEye posted... I simply removed the "join multiple code
lines" symbol (the colon) and physically split the joined lines into
separate lines (which is my personal preference).

--
Rick (MVP - Excel)

"Maggie" wrote in message

...
On Jan 28, 2:56 pm, RadarEye wrote:





On 28 jan, 20:28, Maggie wrote:


I have a worksheet named Data that I would like for a row to be
highlighted when someone enters Paid Off, Missing and Other . How do
I do a macro to perform this? I would like each type to be a
different color such as Paid off to be highlighted yellow, Missing
red,and Other pink.
Please help


Hai Maggie,


For starters VBA has 8 shorthand colors
vbBlack
vbRed
vbGreen
vbYellow
vbBlue
vbMagenta
vbCyan
vbWhite


Next to this you can use a colorindex.


To come back to your question:
Copy the macro below into the macropar of the sheet where you want the
colorchanging occur


Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Value
Case "Paid off": Target.EntireRow.Interior.Color = vbYellow
Case "Missing": Target.EntireRow.Interior.Color = vbRed
Case "Other": Target.EntireRow.Interior.Color = vbMagenta
End Select
End Sub


HTH,
Wouter


Thanks, that worked perfect, but if I accidently put in Paid Off I
have to manually change the fill is there a way when I delete the
entry, it will put the fill back to original?- Hide quoted text -

- Show quoted text -


Why won't the macro work when I protect the sheet?


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro needed to highlight a row

On Wed, 28 Jan 2009 13:09:11 -0800 (PST), Maggie
wrote:

Why won't the macro work when I protect the sheet?


Protect in the event.

Private Sub Worksheet_Change(ByVal Target As Range)
Protect Password:="password", userinterfaceonly:=True

rest of code


Gord Dibben MS Excel MVP
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
Macro - highlight rows Zen Excel Programming 4 July 3rd 07 10:50 AM
Macro to highlight rows and... Dave Birley Excel Programming 1 May 1st 07 01:38 PM
Macro to Highlight EJS[_2_] Excel Programming 5 May 30th 06 02:23 PM
Macro to Highlight Range LLoraine Excel Discussion (Misc queries) 2 April 19th 06 02:41 PM
Highlight Cell Macro palley Excel Programming 1 November 13th 03 06:30 AM


All times are GMT +1. The time now is 02:54 AM.

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"