ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto-sum (without SendKeys) (https://www.excelbanter.com/excel-programming/347483-auto-sum-without-sendkeys.html)

crimsonkng

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









Rowan Drummond[_3_]

Auto-sum (without SendKeys)
 
You're welcome.

crimsonkng wrote:
To Quartz and Rowan:

Wow!

Thanks. Dan





All times are GMT +1. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com