ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell backgroundcolor (https://www.excelbanter.com/excel-programming/347878-cell-backgroundcolor.html)

Starting vba programmer

cell backgroundcolor
 
Hello

How can if run a function after an user changed the backgroundcolor of a
cell? The function must run with a macro or after leaving the colored cell.

Thanks



keepITcool

cell backgroundcolor
 
you cant.

only changing the formula (e.g. the value) if a cell
will trigger an event. changing formatting cannot be caught.

a workaround is trapping the selection change event..
but you'll have to store the formats in a cache..
then compare the actuals with the cached values when
selection changes.

this will be cumbersome and slow if the user makes large selections.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Starting vba programmer wrote :

Hello

How can if run a function after an user changed the backgroundcolor
of a cell? The function must run with a macro or after leaving the
colored cell.

Thanks


David McRitchie

cell backgroundcolor
 
You can't do it efficiently, but you could use Volatile on the function

Functions For Cell Colors
http://www.cpearson.com/excel/colors.htm

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"keepITcool" wrote in message .com...
you cant.

only changing the formula (e.g. the value) if a cell
will trigger an event. changing formatting cannot be caught.

a workaround is trapping the selection change event..
but you'll have to store the formats in a cache..
then compare the actuals with the cached values when
selection changes.

this will be cumbersome and slow if the user makes large selections.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Starting vba programmer wrote :

Hello

How can if run a function after an user changed the backgroundcolor
of a cell? The function must run with a macro or after leaving the
colored cell.

Thanks




st120869[_5_]

cell backgroundcolor
 

Hello,
My question is an adaption of the first thread - I have used the scrpit
below to change the background colour of any cell contacts that have
been changed. I would like to adapt it to only change cells when the
user changes a formula inside the cells.

I do not want to protect the cell contents

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 37
Target.Interior.Pattern = xlSolid
End Sub


--
st120869
------------------------------------------------------------------------
st120869's Profile: http://www.excelforum.com/member.php...o&userid=18330
View this thread: http://www.excelforum.com/showthread...hreadid=492658



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com