Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Background color change

I have a VBA routine, run from Access, that writes out data to an spreadsheet
(using Automation). In my spreadsheet I've added a routine to change the
background color of any cell that is changed. The problem is, my Access
program, in populating the spreadsheet, is causing the background to change
as it writes values to the spreadsheet. I only want the background to change
by a user, after the spreadsheet is populated

Is there a way to do that? If I can programmatically add the event
procedure to the spreadsheet after is is populated that would problaby do it.
However, i don't know how to do that, or if it can be done. Thanks for your
help.

Regards,
Leif
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Background color change

the first choice is
xlApp.EnableEvents = False

but it is recognized that in some verions of Excel, this doesn't work. So
next,

Why not simply

Cells.Interior.ColorIndex = -4142 ' xlNone

after you are done updating.

or restrict this code to the range where you were working.

an alternative would be a cell that is normally blank but you place a value
in it when you are ready to write.

You change routine would be altered to not color this cell and not color any
cell if this cell contains a value. then clear this cell at the end.

Adding the event procedure would be a distant choice for me.
http://www.cpearson.com/excel/vbe.htm


--
Regards,
Tom Ogilvy



"Leif" wrote:

I have a VBA routine, run from Access, that writes out data to an spreadsheet
(using Automation). In my spreadsheet I've added a routine to change the
background color of any cell that is changed. The problem is, my Access
program, in populating the spreadsheet, is causing the background to change
as it writes values to the spreadsheet. I only want the background to change
by a user, after the spreadsheet is populated

Is there a way to do that? If I can programmatically add the event
procedure to the spreadsheet after is is populated that would problaby do it.
However, i don't know how to do that, or if it can be done. Thanks for your
help.

Regards,
Leif

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
Checkbox to change background color, font color and remove/ add bo Sara Excel Discussion (Misc queries) 2 May 1st 23 11:43 AM
change background color Chris Excel Discussion (Misc queries) 2 September 8th 06 02:32 PM
how can I conditionally change font color, or background color? MOHA Excel Worksheet Functions 3 August 21st 06 06:57 PM
change background row color with change of date in a cell Urszula Excel Discussion (Misc queries) 5 May 17th 06 07:56 AM
Change of text or background color doesn't change on the screen. Susan Excel Discussion (Misc queries) 5 July 29th 05 07:18 PM


All times are GMT +1. The time now is 12:50 AM.

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

About Us

"It's about Microsoft Excel"