Thread: Return to range
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 244
Default Return to range

This should do the trick

Private Sub DelXtrRws (
Dim Rng as Range, x as Singl
Set rng = ActiveSheet.Range("YourRangeName")
x = rng.Rows.Count - 2
if x <= 0 then Exit Su
rng.Offset(2, 0).Resize(x).EntireRow.Delet
End Sub
----- gavmer wrote: ----

Understood. Are you able to suggest an alternative?? rows 20-24 are blank. range is rows 21-22. data pastes into row 21 and expands up to 100 rows. When finalised, a user clicks to have the expanded range revert to original (hopefully) so that the sheet may be used again from scratch. How else may i do this???? Any ideas??

Cheers!!!

----- chris wrote: ----

I can't see how there is anyway progromatically to determine what the "Original" size of your named Range was

----- gavmer wrote: ----

Hello

I am using the following code that deletes rows in a range.

This range expands as info is added. A user clicks a button to have th
rows that were inserted deleted however, when performed, the range i
deleted. What i need is for the range to not actually be deleted bu
for the inserted rows to beleted/removed and for the range to revert t
normal

Can someone please assist?

Sheets("TEMP").Range("pricing").Delete Shift:=xlShiftU


--
Message posted from http://www.ExcelForum.com