ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   test code (https://www.excelbanter.com/excel-programming/298760-test-code.html)

gavmer[_13_]

test code
 
Hello all,

The code below has been supplied to me however, i am having troubl
running it. A button on sheet 2 (quote) runs the code to delete th
ranger on sheet 1 (summary). At this point, nothing happens. The rang
name is 'appendix'. Can someone please test this????

Can this also be included to claer contents on sheet 2 (quote)

ActiveSheet.Range("D13:D15,C19:J19").ClearContents


Cheers!!!!!

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

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


Don Guillett[_4_]

test code
 
try this for any named range in the workbook.
range("yourrangename").clear

--
Don Guillett
SalesAid Software

"gavmer " wrote in message
...
Hello all,

The code below has been supplied to me however, i am having trouble
running it. A button on sheet 2 (quote) runs the code to delete the
ranger on sheet 1 (summary). At this point, nothing happens. The range
name is 'appendix'. Can someone please test this????

Can this also be included to claer contents on sheet 2 (quote)

ActiveSheet.Range("D13:D15,C19:J19").ClearContents


Cheers!!!!!

Private Sub DelXtrRws ()
Dim Rng as Range, x as Single
Set rng = ActiveSheet.Range("YourRangeName")
x = rng.Rows.Count - 2
if x <= 0 then Exit Sub
rng.Offset(2, 0).Resize(x).EntireRow.Delete
End Sub


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




gavmer[_14_]

test code
 
Hi Don,

Thank you!!! Where would i insert into my original code!!!!

Cheers!!

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


gavmer[_15_]

test code
 
Hi Don,

All is fine and figured out. Thanks for your help!!!
Cheers!!!

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


Don Guillett[_4_]

test code
 
glad to help. Feels better when you figure it out by yourself, doesn't it?

--
Don Guillett
SalesAid Software

"gavmer " wrote in message
...
Hi Don,

All is fine and figured out. Thanks for your help!!!
Cheers!!!!


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




gavmer[_19_]

test code
 
you have no idea. I have been given a huge taks and been bothering yo
all as i have NEVER used vba. But, ive learnt alot thanks to you al
and when i work something out for myself, yes, it is very rewarding!

Thanks to all!!!!!

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



All times are GMT +1. The time now is 11:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com