Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Return to range

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Return to range

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Return to range

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Return to range

great!!! Ill give it a shot. How do i set it to run on a worksheet name
'summary'??

Cheers!!!

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return date if in range, else return blank LisaL Excel Worksheet Functions 1 July 22nd 09 03:23 PM
Return a value either from a two-row or two-column range thaenn Excel Discussion (Misc queries) 1 October 12th 06 04:15 PM
return min. of range except 0 Melissa Excel Discussion (Misc queries) 2 January 11th 06 12:14 PM
Return Range in VB ray Excel Programming 4 December 11th 03 08:12 PM
How do I return the name of a Range? **Archie** Excel Programming 1 November 13th 03 11:31 PM


All times are GMT +1. The time now is 02:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"