View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Getting wrong last cell when using usedrange in macro in Excel


The cells don't need to be formatted for Excel to treat them as used.

If the cells were cleared using "clear contents" Excel still thinks they are
used.


Gord Dibben MS Excel MVP

On Tue, 23 Jun 2009 08:12:02 -0700, Michael Arch
wrote:

This happens when the cells are formatted, although there is no data excel
thinks there is. To avoid this issue, you may want to delete all cells below
Y10 using the Ctrl - short cut is the fastest way.
Alternatively, you could use this:
iLastrow= Range("Y65536").end(xlup).Row