Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro for Changing Cell Background Color

Hello,

I'm trying to setup a macro that will automatically change the color of
a cell's background when the cell's date data equals TODAY(). I know I
can do this with conditional formatting, but I also need it to change
to another color once a checkbox has been checked, and this will not
work with conditional formatting (any changes to the background color
will be overridden by the conditional formatting). Is there anyway to
do this in VBcode? Any help would be fantastic. Thanks!

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Macro for Changing Cell Background Color

Hi Rick,

If you're happy to use conditional formats, why not use 3 FC's

FC1 checked and Today
FC2 checked
FC3 today

where Checked refers to the Checkbox linked cell or some other value you
change by code with the checkbox and today = cell's date (IsFormula).

Regards,
Peter T


wrote in message
ups.com...
Hello,

I'm trying to setup a macro that will automatically change the color of
a cell's background when the cell's date data equals TODAY(). I know I
can do this with conditional formatting, but I also need it to change
to another color once a checkbox has been checked, and this will not
work with conditional formatting (any changes to the background color
will be overridden by the conditional formatting). Is there anyway to
do this in VBcode? Any help would be fantastic. Thanks!

Rick



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro for Changing Cell Background Color

Hey Peter,

Could you explain how to create the three "FC's"? I know how to make a
condition such as 'less than a certain cell value' but I'm not sure how
to make a conditional format that relys on a checkbox and a cell value.
Thanks!

Rick


Peter T wrote:
Hi Rick,

If you're happy to use conditional formats, why not use 3 FC's

FC1 checked and Today
FC2 checked
FC3 today

where Checked refers to the Checkbox linked cell or some other value you
change by code with the checkbox and today = cell's date (IsFormula).

Regards,
Peter T


wrote in message
ups.com...
Hello,

I'm trying to setup a macro that will automatically change the color of
a cell's background when the cell's date data equals TODAY(). I know I
can do this with conditional formatting, but I also need it to change
to another color once a checkbox has been checked, and this will not
work with conditional formatting (any changes to the background color
will be overridden by the conditional formatting). Is there anyway to
do this in VBcode? Any help would be fantastic. Thanks!

Rick


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro for Changing Cell Background Color

As he said, link the checkbox to a cell and then check the value of the cell
(indicating the status of the checkbox).

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
Hey Peter,

Could you explain how to create the three "FC's"? I know how to make a
condition such as 'less than a certain cell value' but I'm not sure how
to make a conditional format that relys on a checkbox and a cell value.
Thanks!

Rick


Peter T wrote:
Hi Rick,

If you're happy to use conditional formats, why not use 3 FC's

FC1 checked and Today
FC2 checked
FC3 today

where Checked refers to the Checkbox linked cell or some other value you
change by code with the checkbox and today = cell's date (IsFormula).

Regards,
Peter T


wrote in message
ups.com...
Hello,

I'm trying to setup a macro that will automatically change the color

of
a cell's background when the cell's date data equals TODAY(). I know

I
can do this with conditional formatting, but I also need it to change
to another color once a checkbox has been checked, and this will not
work with conditional formatting (any changes to the background color
will be overridden by the conditional formatting). Is there anyway to
do this in VBcode? Any help would be fantastic. Thanks!

Rick






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro for Changing Cell Background Color

Rick, rather than use less than etc., you need to change the condition
dropdown to Formula Is and add a formula. Peter suggesting linking the
checkbox to a cell, so assuming it is a Forms toolbar checkbox, a formula
would be of the type

=AND(M1=1,A1=TODAY())

where M1 is the checkbox linked cell and A1 is the data cell.



--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
Hey Peter,

Could you explain how to create the three "FC's"? I know how to make a
condition such as 'less than a certain cell value' but I'm not sure how
to make a conditional format that relys on a checkbox and a cell value.
Thanks!

Rick


Peter T wrote:
Hi Rick,

If you're happy to use conditional formats, why not use 3 FC's

FC1 checked and Today
FC2 checked
FC3 today

where Checked refers to the Checkbox linked cell or some other value you
change by code with the checkbox and today = cell's date (IsFormula).

Regards,
Peter T


wrote in message
ups.com...
Hello,

I'm trying to setup a macro that will automatically change the color

of
a cell's background when the cell's date data equals TODAY(). I know

I
can do this with conditional formatting, but I also need it to change
to another color once a checkbox has been checked, and this will not
work with conditional formatting (any changes to the background color
will be overridden by the conditional formatting). Is there anyway to
do this in VBcode? Any help would be fantastic. Thanks!

Rick




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Macro for Changing Cell Background Color

Checkboxes from both Forms and Control toolbox menu's have a linked cell
property, albeit applied in very different ways. For this example set the
linked cell to $A$6.

Put some dates, mixed with some of today, in col-C with the first in C1.

With C1 selected, apply these CF's with appropriate formats

Formula is / =AND($A$6=TRUE,C1=TODAY())
Formula is / =$A$6=TRUE
Cell value is / equal to / =TODAY()

No relative addressing for C1 (remove $), so you can copy the cell and paste
special formats to other dates that also relate to the checkbox with linked
cell A6.

Regards,
Peter T

wrote in message
oups.com...
Hey Peter,

Could you explain how to create the three "FC's"? I know how to make a
condition such as 'less than a certain cell value' but I'm not sure how
to make a conditional format that relys on a checkbox and a cell value.
Thanks!

Rick


Peter T wrote:
Hi Rick,

If you're happy to use conditional formats, why not use 3 FC's

FC1 checked and Today
FC2 checked
FC3 today

where Checked refers to the Checkbox linked cell or some other value you
change by code with the checkbox and today = cell's date (IsFormula).

Regards,
Peter T


wrote in message
ups.com...
Hello,

I'm trying to setup a macro that will automatically change the color

of
a cell's background when the cell's date data equals TODAY(). I know

I
can do this with conditional formatting, but I also need it to change
to another color once a checkbox has been checked, and this will not
work with conditional formatting (any changes to the background color
will be overridden by the conditional formatting). Is there anyway to
do this in VBcode? Any help would be fantastic. Thanks!

Rick




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Macro for Changing Cell Background Color

typo,

No relative addressing for C1


Relative addressing for C1 (obviously !)

(I didn't see earlier similar suggestions when I posted)

Peter T


"Peter T" <peter_t@discussions wrote in message
...
Checkboxes from both Forms and Control toolbox menu's have a linked cell
property, albeit applied in very different ways. For this example set the
linked cell to $A$6.

Put some dates, mixed with some of today, in col-C with the first in C1.

With C1 selected, apply these CF's with appropriate formats

Formula is / =AND($A$6=TRUE,C1=TODAY())
Formula is / =$A$6=TRUE
Cell value is / equal to / =TODAY()

No relative addressing for C1 (remove $), so you can copy the cell and

paste
special formats to other dates that also relate to the checkbox with

linked
cell A6.

Regards,
Peter T

wrote in message
oups.com...
Hey Peter,

Could you explain how to create the three "FC's"? I know how to make a
condition such as 'less than a certain cell value' but I'm not sure how
to make a conditional format that relys on a checkbox and a cell value.
Thanks!

Rick


Peter T wrote:
Hi Rick,

If you're happy to use conditional formats, why not use 3 FC's

FC1 checked and Today
FC2 checked
FC3 today

where Checked refers to the Checkbox linked cell or some other value

you
change by code with the checkbox and today = cell's date (IsFormula).

Regards,
Peter T


wrote in message
ups.com...
Hello,

I'm trying to setup a macro that will automatically change the color

of
a cell's background when the cell's date data equals TODAY(). I

know
I
can do this with conditional formatting, but I also need it to

change
to another color once a checkbox has been checked, and this will not
work with conditional formatting (any changes to the background

color
will be overridden by the conditional formatting). Is there anyway

to
do this in VBcode? Any help would be fantastic. Thanks!

Rick






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
Changing Cell Background Color Depending on the Number Matlock Excel Discussion (Misc queries) 1 February 18th 08 12:41 AM
changing cell background color okelbes Excel Worksheet Functions 1 September 20th 06 03:28 PM
Changing background color based on different cell djarcadian Excel Discussion (Misc queries) 3 August 10th 06 10:44 PM
automatically changing the background color of a cell martin Excel Programming 8 January 6th 05 11:00 AM
Changing the Cell Background Color when a keyword is entered Rachael[_2_] Excel Programming 7 February 24th 04 04:16 PM


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