Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dynamically change cell range in formula by background color?

Have a spreadsheet with columns representing weekly data. I have
formulas which total history weekly data, and the forecasted data for
future weeks. As weeks go by I change the color of the background of
the last week to show that it is now actual history data. What is the
best way that my forumlas can be adjusted to represent this color
change without having to edit the range of cells manually? Is there a
better way to do something like this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dynamically change cell range in formula by background color?

Dim BigRange as Range, rng as Range, cell as Range
set BigRange = Range("A1").CurrentRegion
for each cell in BigRange
if cell.Interior.ColorIndex = 3 then
if rng is nothing then
set rng = cell
else
set rng = union(rng,cell)
end if
Next
rng.Name = "MyHistory"

Then in your formulas refer to MyHistory

Probably much better ways not using color, but based on the minimal
information provided

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
Have a spreadsheet with columns representing weekly data. I have
formulas which total history weekly data, and the forecasted data for
future weeks. As weeks go by I change the color of the background of
the last week to show that it is now actual history data. What is the
best way that my forumlas can be adjusted to represent this color
change without having to edit the range of cells manually? Is there a
better way to do something like this?



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
change background color based on range value DanL New Users to Excel 2 February 6th 09 09:35 PM
How do I change background color of highlighted Excel range ? Jim Excel Discussion (Misc queries) 0 June 6th 08 07:59 PM
change background row color with change of date in a cell Urszula Excel Discussion (Misc queries) 5 May 17th 06 07:56 AM
background color of my cell does not change Colorblinded Excel Discussion (Misc queries) 2 March 27th 05 04:55 PM
I need to change the BG color of a cell dynamically Degobah Excel Programming 2 December 11th 03 05:04 PM


All times are GMT +1. The time now is 09:14 PM.

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"