View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default delete rows w/o hardcoding numbers

Rows(intBeginDelete & ":" & intEndDelete).Delete

might work ok.


Dave B wrote:

I'd like to delete a group of rows. Normally I would do:

Rows("12:45").Delete Shift:=xlUp

But the row numbers are stored in variables. I can't do (causes an
error):

Rows("intBeginDelete:intEndDelete").Delete Shift:=xlUp

I can do it using a For...Next loop, deleting the rows one at a time,
but I'm working with lots of row groups & files and that makes
execution slow. Is there an easier/faster way to do this?


--

Dave Peterson