Wednesday, February 23, 2011
Function To Sum specific fill or background colored cells in a range
Suppose you want to add cell values on the basis of the background or fill color.
Here is the fucntion.
Function sum_colored_values(x As Range, su As Range)
Dim Y As Range
Dim sm1 As Long
For Each Y In su
If Y.Interior.Color = x.Interior.Color Then
sm1 = sm1 + Y.Value
sum_colored_values = sm1
type like sum_colored_values(f9,$A$2:$A$23)
"$A$2:$A$23" - is a range in which you have to sum the cell values .
"f9" - is a cell having background or fill color
the function will return the sum of values in a range passed who are having the background color same as of "f9"
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
Please make sure that you have the latest Version Tool Last Updated on 17 Feb, 2012 Version 1.6 English Version For Excel 2007 &...
Adding Marquee in Excel worksheet Step 1 Step 2 Example 1 Continuous scrolling Add below code module1 or any new module Sub r...