Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Macro for shading

I'd like to know wheater it is possible to have a cell shaded once an action
has been taken on it.

For example I have each cell in collums [A1] --- [D1] with a drop
list/validation. Once action has been taken I'd like for it to become shaded.
Is this possible?

Thank you in advance.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Macro for shading

Hi,
If you mean a specific action, ie a specific entry into a cell, then you can
do that with conditional formatting.
If you mean a more general action, like the selection of an option (but no
particular option) from the drop down menu, then you'd need a Change Event
macro.
Regards - Dave.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Macro for shading

On Mon, 2 Jun 2008 10:33:00 -0700, Atomic
wrote:

I'd like to know wheater it is possible to have a cell shaded once an action
has been taken on it.

For example I have each cell in collums [A1] --- [D1] with a drop
list/validation. Once action has been taken I'd like for it to become shaded.
Is this possible?

Thank you in advance.



Try if this macro does what you expect:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:D1")) Is Nothing Then
Target.Interior.ColorIndex = 15
End If
End Sub

Hope this helps / Lars-Åke

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Macro for shading

Thank you Lars-Ã…ke, that is exactly what I had in mind.

I noticed that the colour stayed as is when the entry was removed or
deleted. Is there a way to return it to "white" if say I enter a a "00" in
the cell or if the entry was deleted?

Thank you.


"Lars-Ã…ke Aspelin" wrote:

On Mon, 2 Jun 2008 10:33:00 -0700, Atomic
wrote:

I'd like to know wheater it is possible to have a cell shaded once an action
has been taken on it.

For example I have each cell in collums [A1] --- [D1] with a drop
list/validation. Once action has been taken I'd like for it to become shaded.
Is this possible?

Thank you in advance.



Try if this macro does what you expect:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:D1")) Is Nothing Then
Target.Interior.ColorIndex = 15
End If
End Sub

Hope this helps / Lars-Ã…ke

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Macro for shading

The following sets the background color to white if the value entered
is equal to 0.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:D1")) Is Nothing Then
Target.Interior.ColorIndex = 15
If Target.Value = 0 Then
Target.Interior.ColorIndex = 0
End If
End If
End Sub

Hope this helps / Lars-Åke


On Mon, 2 Jun 2008 13:30:02 -0700, Atomic
wrote:

Thank you Lars-Åke, that is exactly what I had in mind.

I noticed that the colour stayed as is when the entry was removed or
deleted. Is there a way to return it to "white" if say I enter a a "00" in
the cell or if the entry was deleted?

Thank you.


"Lars-Åke Aspelin" wrote:

On Mon, 2 Jun 2008 10:33:00 -0700, Atomic
wrote:

I'd like to know wheater it is possible to have a cell shaded once an action
has been taken on it.

For example I have each cell in collums [A1] --- [D1] with a drop
list/validation. Once action has been taken I'd like for it to become shaded.
Is this possible?

Thank you in advance.



Try if this macro does what you expect:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:D1")) Is Nothing Then
Target.Interior.ColorIndex = 15
End If
End Sub

Hope this helps / Lars-Åke




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Macro for shading

Thank you Lars-Ã…ke, again. I'll study this formula now and try some new things.
really appreciate it. ^_^)v

"Lars-Ã…ke Aspelin" wrote:

The following sets the background color to white if the value entered
is equal to 0.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:D1")) Is Nothing Then
Target.Interior.ColorIndex = 15
If Target.Value = 0 Then
Target.Interior.ColorIndex = 0
End If
End If
End Sub

Hope this helps / Lars-Ã…ke


On Mon, 2 Jun 2008 13:30:02 -0700, Atomic
wrote:

Thank you Lars-Ã…ke, that is exactly what I had in mind.

I noticed that the colour stayed as is when the entry was removed or
deleted. Is there a way to return it to "white" if say I enter a a "00" in
the cell or if the entry was deleted?

Thank you.


"Lars-Ã…ke Aspelin" wrote:

On Mon, 2 Jun 2008 10:33:00 -0700, Atomic
wrote:

I'd like to know wheater it is possible to have a cell shaded once an action
has been taken on it.

For example I have each cell in collums [A1] --- [D1] with a drop
list/validation. Once action has been taken I'd like for it to become shaded.
Is this possible?

Thank you in advance.


Try if this macro does what you expect:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:D1")) Is Nothing Then
Target.Interior.ColorIndex = 15
End If
End Sub

Hope this helps / Lars-Ã…ke



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
Creating a Macro For Shading Rows - Or Should I Use Conditional Formatting? [email protected] Excel Worksheet Functions 3 May 3rd 07 11:41 PM
Conditional Cell Shading (based on the shading of other cells) Tubby Excel Worksheet Functions 2 June 20th 06 10:03 PM
shading a rowwhen a time is entered but no shading when 0 is enter fomula problems Excel Worksheet Functions 7 October 23rd 05 08:44 PM
Shading cells with a Macro maacmaac Excel Discussion (Misc queries) 1 August 18th 05 03:48 PM
Is there a formula, function or macro that accounts for shading of a cell or row? Jamie Furlong Excel Discussion (Misc queries) 1 August 12th 05 09:55 AM


All times are GMT +1. The time now is 01:18 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"