PC Review


Reply
Thread Tools Rate Thread

Deleting Check Boxes Within a Range

 
 
hovious3@yahoo.com
Guest
Posts: n/a
 
      20th Nov 2007
Hello, all.

I was successful in deleting check boxes from a worksheet column by
using:

Sub DeleteCheckboxes()
Dim CBox As CheckBox
Const col As Long = 1 '<<==== (Column A) CHANGE

For Each CBox In ActiveSheet.CheckBoxes
If CBox.TopLeftCell.Column = col Then
CBox.Delete
End If
Next

End Sub

HOWEVER, I would like to delete several columns or a range at one
time. Can someone put me on the right track? Thank you!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      20th Nov 2007
Sub DeleteCheckboxes()
Dim CBox As CheckBox
Const col As Long = 1 '<<==== (Column A) CHANGE

For Each CBox In ActiveSheet.CheckBoxes
select case CBox.TopLeftCell.Column
Case col1, col2, col3
CBox.Delete

end select
Next

End Sub


"(E-Mail Removed)" wrote:

> Hello, all.
>
> I was successful in deleting check boxes from a worksheet column by
> using:
>
> Sub DeleteCheckboxes()
> Dim CBox As CheckBox
> Const col As Long = 1 '<<==== (Column A) CHANGE
>
> For Each CBox In ActiveSheet.CheckBoxes
> If CBox.TopLeftCell.Column = col Then
> CBox.Delete
> End If
> Next
>
> End Sub
>
> HOWEVER, I would like to delete several columns or a range at one
> time. Can someone put me on the right track? Thank you!
>

 
Reply With Quote
 
hovious3@yahoo.com
Guest
Posts: n/a
 
      20th Nov 2007
On Nov 20, 12:31 pm, Joel <J...@discussions.microsoft.com> wrote:
> Sub DeleteCheckboxes()
> Dim CBox As CheckBox
> Const col As Long = 1 '<<==== (Column A) CHANGE
>
> For Each CBox In ActiveSheet.CheckBoxes
> select case CBox.TopLeftCell.Column
> Case col1, col2, col3
> CBox.Delete
>
> end select
> Next
>
> End Sub
>
> "hovio...@yahoo.com" wrote:
> > Hello, all.

>
> > I was successful in deleting check boxes from a worksheet column by
> > using:

>
> > Sub DeleteCheckboxes()
> > Dim CBox As CheckBox
> > Const col As Long = 1 '<<==== (Column A) CHANGE

>
> > For Each CBox In ActiveSheet.CheckBoxes
> > If CBox.TopLeftCell.Column = col Then
> > CBox.Delete
> > End If
> > Next

>
> > End Sub

>
> > HOWEVER, I would like to delete several columns or a range at one
> > time. Can someone put me on the right track? Thank you!


Thanks, Joel.

I am using your code to test some worksheets but can't seem to get
this to work yet. I will play around with it some more.
 
Reply With Quote
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      20th Nov 2007
col1, col2, and col3 need to be numbers or defined someplace in the code.
col should be 1 for Col A, 2 for Col B .......

"(E-Mail Removed)" wrote:

> On Nov 20, 12:31 pm, Joel <J...@discussions.microsoft.com> wrote:
> > Sub DeleteCheckboxes()
> > Dim CBox As CheckBox
> > Const col As Long = 1 '<<==== (Column A) CHANGE
> >
> > For Each CBox In ActiveSheet.CheckBoxes
> > select case CBox.TopLeftCell.Column
> > Case col1, col2, col3
> > CBox.Delete
> >
> > end select
> > Next
> >
> > End Sub
> >
> > "hovio...@yahoo.com" wrote:
> > > Hello, all.

> >
> > > I was successful in deleting check boxes from a worksheet column by
> > > using:

> >
> > > Sub DeleteCheckboxes()
> > > Dim CBox As CheckBox
> > > Const col As Long = 1 '<<==== (Column A) CHANGE

> >
> > > For Each CBox In ActiveSheet.CheckBoxes
> > > If CBox.TopLeftCell.Column = col Then
> > > CBox.Delete
> > > End If
> > > Next

> >
> > > End Sub

> >
> > > HOWEVER, I would like to delete several columns or a range at one
> > > time. Can someone put me on the right track? Thank you!

>
> Thanks, Joel.
>
> I am using your code to test some worksheets but can't seem to get
> this to work yet. I will play around with it some more.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting from a gridview with check boxes JJ297 Microsoft ASP .NET 1 23rd Oct 2007 05:03 PM
Pop-Up Dialogue Box/check boxes/deleting worksheets =?Utf-8?B?QW5kcmV3IFNjaHVsbWFu?= Microsoft Excel Programming 2 1st Aug 2007 02:52 AM
Deleting Check Boxes John Microsoft Excel Discussion 3 9th Oct 2005 01:40 PM
Problem Deleting Check Boxes created from Forms Toolbar =?Utf-8?B?U3V6YW4=?= Microsoft Excel Misc 4 15th Sep 2005 06:30 PM
Deleting check boxes Tempy Microsoft Excel Programming 8 20th May 2004 02:28 AM


Features
 

Advertising
 

Newsgroups
 


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