subtotals based on font colour

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
 
P

pshepard

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top