LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Button to set colour of selected cells & then force sheet calculat

Having read up on two fantastically informative websites about excel colour
functions:
http://www.xldynamic.com/source/xld.ColourCounter.html
http://www.cpearson.com/excel/colors.htm

I have inserted the UDFs suggested so that the spreadsheet counts how many
red cells there are within a certain range. However, as explained on the
sites, changing a cell's colour does not trigger a worksheet calculation, so
if one or more cells change the result of the formula used is incorrect until
a manual sheet recalculation.

The xldynamic website suggests "to overcome this, you need to force a sheet
calculate. What I do in applications that use this technique is to create a
button(s) to set the colour(s), and within the code attached to the
button(s), I do a manual sheet calculate".

Unfortunately I do not know how to do this. Ideally I need to create a
button that will (a) turn the selected cells red and (b) then automatically
run a sheet calculation, so that whenever cells are altered with this button,
the formula is ALWAYS correct.

Could there also be a button included to turn all cells in the same range
back to "no fill" (i.e. clear answers so the user can start from scratch
again)?

Could anybody help this macro learner please?

Many thanks in advance, Neil Goldwasser

PS - I have only just this afternoon learned what a UDF is, and discovered
that I could only get it to work by placing it in a module, rather than
attaching it to a sheet's "Microsoft Excel Object". Is there a rule on when
to include new modules? Or can I put all the UDF's into one module?
 
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
selected cells doesnot change colour Zarrar Janjua New Users to Excel 9 May 22nd 07 02:45 PM
'selected cells' highlight colour darker in Excel 2007 Lucy Setting up and Configuration of Excel 0 March 29th 07 01:44 AM
change highlight colour of selected cells Starskys Bird Excel Discussion (Misc queries) 1 April 29th 06 02:27 PM
how to create a toolbar button to set selected cells to wrap text steveguebert Excel Discussion (Misc queries) 1 December 9th 05 12:34 AM
Sum partucular cells by colour of sheet Geoffers Excel Programming 2 June 29th 04 01:04 PM


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