View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bucky[_2_] Bucky[_2_] is offline
external usenet poster
 
Posts: 2
Default improve DeleteBlankRows()

I was using Pearson's DeleteBlankRows() function, but I found a minor
issue. The problem is that if your sheet has blank rows at the top,
they don't get deleted. I believe the problem is that

Set Rng = ActiveSheet.UsedRange.Rows

does not include the blank rows at the top (since they are not
considered "UsedRange"). I think the fix is to modify the Set Rng line
to include those blank rows. I'm not familiar with the objects and
properties, so can someone help me come up with the most elegant way to
do this? Conceptually, this is what I want to do:

Set Rng = ActiveSheet.(A1 to LastCellOfUsedRange).Rows


http://www.cpearson.com/excel/deleti...eleteBlankRows