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

Hi all,

With the following, how would i amend to include range "unit333" o
sheet "t800"?????

Private Sub CommandButton6_Click()
Dim rng As Range, x As Single
Dim wsquote As Worksheet
Set wsquote = Worksheets("sheet1")
On Error Resume Next
Set rng = wsquote.Range("unit356")
If Err.Number = 0 Then
x = rng.Rows.Count
Worksheets("sheet1").Unprotect Password:="jenjen1"
wsquote.Range("knife3").ClearContents
rng.Offset(0, 0).Resize(x).EntireRow.Delete
Else
MsgBox "You have already deleted Unit 3"
End If
Worksheets("sheet1").Protect Password:="jenjen1"
End Sub

???????????

CHeers!!!!!!!

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Addition to existing code

With the following, how would i amend to include range "unit333" on
sheet "t800"?????

Private Sub CommandButton6_Click()
Dim rng As Range, x As Single
Dim wsquote As Worksheet
Set wsquote = Worksheets("t800")
On Error Resume Next
Set rng = wsquote.Range("unit333")
If Err.Number = 0 Then
x = rng.Rows.Count
Worksheets("sheet1").Unprotect Password:="jenjen1"
wsquote.Range("knife3").ClearContents
rng.Offset(0, 0).Resize(x).EntireRow.Delete
Else
MsgBox "You have already deleted Unit 3"
End If
Worksheets("sheet1").Protect Password:="jenjen1"
End Sub

Not sure about knife3

--
Regards,
Tom Ogilvy


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

With the following, how would i amend to include range "unit333" on
sheet "t800"?????

Private Sub CommandButton6_Click()
Dim rng As Range, x As Single
Dim wsquote As Worksheet
Set wsquote = Worksheets("sheet1")
On Error Resume Next
Set rng = wsquote.Range("unit356")
If Err.Number = 0 Then
x = rng.Rows.Count
Worksheets("sheet1").Unprotect Password:="jenjen1"
wsquote.Range("knife3").ClearContents
rng.Offset(0, 0).Resize(x).EntireRow.Delete
Else
MsgBox "You have already deleted Unit 3"
End If
Worksheets("sheet1").Protect Password:="jenjen1"
End Sub

???????????

CHeers!!!!!!!!


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Addition to existing code

Hi tom,

Thank you for that but i was hoping to incorporate that as an additio
to the existing code so that it deleted 2 ranges from 2 sheets????

Any ideas???

Cheers!!!

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Addition to existing code

Private Sub CommandButton6_Click()
Dim rng As Range, rng1 as Range
Dim wsquote As Worksheet
Dim wsquote1 as Worksheet
set wsquote = Worksheets("sheet1")
Set wsQuote1 = Worksheets("t800")
On Error Resume Next
Set rng = wsquote.Range("unit356")
Set rng1 = wsQuote.Range("unit333")
If Err.Number = 0 Then
wsquote.Unprotect Password:="jenjen1"
wsquote1.Unprotect Password:="jenjen1"
wsquote.Range("knife3").ClearContents
rng.EntireRow.Delete
rng1.EntireRow.Delete
wsquote.Protect Password:="jenjen1"
wsquote1.Protect Password:="jenjen1"
Else
MsgBox "You have already deleted Unit 3"
End If

End Sub

--
Regards,
Tom Ogilvy

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

Thank you for that but i was hoping to incorporate that as an addition
to the existing code so that it deleted 2 ranges from 2 sheets????

Any ideas???

Cheers!!!!


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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Addition to existing code

Thats great tom...thank you!!!

--
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
addition error code is 1E+05. What does that mean? jojosf Excel Discussion (Misc queries) 4 April 4th 23 10:17 AM
Help with existing code ploddinggaltn Excel Discussion (Misc queries) 1 November 27th 06 09:46 PM
Addition to code gav meredith Excel Programming 0 April 29th 04 02:05 AM
Addition code for 110 TextBoxes John Wilson Excel Programming 4 January 27th 04 03:41 AM
Addition code for 110 TextBoxes Todd Huttenstine[_3_] Excel Programming 1 January 27th 04 03:11 AM


All times are GMT +1. The time now is 04:09 PM.

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"