When you recorded it, that was a function on the worksheet. Typing [COLOR=blue white]=Sum("R2:AB2")[/color] in a cell will work fine. But SUM isn't a recognized function in VBA.
To get around this, you can use:
Code:
Total = WorksheetFunction.Sum(Range("R2:AB2"))
[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]
Help us help you. Please read FAQ181-2886 before posting.
What are you trying to do? I'm assuming that total is a number since it is the sum of a range.
What do you expect range(total) (or whatever number you come up with) to give you? Whatever you are expecting, this syntax won't work. It is equivalent to saying range(3). That just doesn't mean anything.
sheets(sh).Range(total) > 0 - Even if total was a proper range, you aren't doing anything in the range to compare to zero. Do you want to sum a range?
Even if you get figured out, sheets(sh).Range(total) > 0 is going to return TRUE or FALSE.
Why would you trim TRUE or FALSE?
Why would you be taking the upper case of TRUE or FALSE?
[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]
Help us help you. Please read FAQ181-2886 before posting.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.