View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
crimsonkng crimsonkng is offline
external usenet poster
 
Posts: 42
Default Auto-sum (without SendKeys)

I have about 50,000 entries (dollar amounts) in Column A. At various (a
couple of thousand) rows, there are empty cells. If I position my cell at
the very bottom (the last empty cell) and I click the auto-sum icon, that
will (correctly) sum the values until the next empty cell (above) is reached.
However, the "record macro" sees that action as either an absolute cell
address (which I don't want) or a specific number of rows (relative address)
which I don't want, either, because the addresses and number of rows change
throughout Column A. So, that macro won't work if I want it to repeat until
it reaches A1.

So, I tried all of these (to represent Alt-equals and then Enter)

SendKeys "%(=){ENTER}"

SendKeys "%={ENTER}"

SendKeys "%(=)"
SendKeys "{ENTER}"

SendKeys "%="
SendKeys "{ENTER}"

but none of 'em worked ... it seemed like Excel didn't even recognize the
SendKeys command ... I mean, nothing happened.

How can I tell my macro to autosum without specifying specific cell
addresses or number of rows? I suspect that there's a simple answer but I
just can't seem to get my head around it.

Dan