subtotals based on font colour

  • Thread starter Thread starter sebyjohn73
  • Start date Start date
S

sebyjohn73

Hi, can some one help me to do subtotals in an excel column, based o
font colour. (There is more than one colour in my sheet
 
Hi,

Once the color numbers are determined (using the macro below), you can then
use the sumif worksheet function to subtotal by color.

The following macro assumes that you have a blank column next to the numbers
with different font colors, and that you have activated the first cell in the
range of numbers.

Sub ColorNumber()

x = ActiveCell.Row
y = ActiveCell.Column

Do While Cells(x, y).Value <> ""

ActiveCell.Offset(0, 1) = ActiveCell.Font.Color
ActiveCell.Offset(1, 0).Activate
x = x + 1

Loop

End Sub

- Peggy
 
Back
Top