Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Return date if in range, else return blank | Excel Worksheet Functions | |||
Return a value either from a two-row or two-column range | Excel Discussion (Misc queries) | |||
return min. of range except 0 | Excel Discussion (Misc queries) | |||
Return Range in VB | Excel Programming | |||
How do I return the name of a Range? | Excel Programming |