PDA

View Full Version : Sum of column



Jow
05-02-2008, 05:22 AM
What I want to do is add up all the numbers in a column (is always 'Column H') and store that amount within a variable, and then check to see if that value is contained within the worksheet name.


So once I have managed to generate a value for the sum of a column, I'm guessing I could use something like this...

If ActiveSheet.Name Like SUMOFCOLUMN Then
...to see whether that value is also within the worksheet name.


The purpose of this is to check whether the amount column balances to the amount in the filename.

Any ideas?

rory
05-02-2008, 05:34 AM
Something like this:

SUMOFCOLUMN = Application.Sum(Range("H:H"))

If Instr(ActiveSheet.Name,SUMOFCOLUMN) > 0 Then

Bob Phillips
05-02-2008, 07:44 AM
SUMOFCOLUMN = Application.Sum(Range("H:H"))
If ActiveSheet.Name Like "*" & SUMOFCOLUMN & "*" Then