Counting cells with data in them
Good idea! I'd forgotten about CountA. But you need to use
Set myRng = .Range("D1", .Range("D65536").End(xlUp)) because Set myRng = .Range("d1", .Range("d1").End(xlDown)) will stop at the first empty cell in Column D. I just tried it. Regards, Wes |
Counting cells with data in them
True, but this apparently isn't an issue for the original poster:
Range(Selection, Selection.End(xlDown)).Select This selects all the cells down to the last cell that has data in it but I would guess that Dave tried it several years ago and is aware of the difference. -- Regards, Tom Ogilvy "SunTzuComm" wrote in message ... Good idea! I'd forgotten about CountA. But you need to use Set myRng = .Range("D1", .Range("D65536").End(xlUp)) because Set myRng = .Range("d1", .Range("d1").End(xlDown)) will stop at the first empty cell in Column D. I just tried it. Regards, Wes |
Counting cells with data in them
In fact, I changed my post to match the OP. 'Cause sometimes there's a reason
the OP used their code. <vbg. Tom Ogilvy wrote: True, but this apparently isn't an issue for the original poster: Range(Selection, Selection.End(xlDown)).Select This selects all the cells down to the last cell that has data in it but I would guess that Dave tried it several years ago and is aware of the difference. -- Regards, Tom Ogilvy "SunTzuComm" wrote in message ... Good idea! I'd forgotten about CountA. But you need to use Set myRng = .Range("D1", .Range("D65536").End(xlUp)) because Set myRng = .Range("d1", .Range("d1").End(xlDown)) will stop at the first empty cell in Column D. I just tried it. Regards, Wes -- Dave Peterson |
All times are GMT +1. The time now is 07:18 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com