Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mac Mac is offline
external usenet poster
 
Posts: 213
Default check box question

Helllo.

I have two problems with my check boxes.

I have created 3 checkboxes on the same worksheet. when I checkbox1 click I
want to delete certain worksheets. When I checkbox2 cliick I want to delete
other sheets. I have set up the macro, but when I click the box I get the
message "data may exist in the sheets selected for deletion. To
permanently delete the data press delete. Is there a way that I do not get
the message and it just deletes the sheets?
This is a part of my code:

Private Sub CheckBox2_Click()
Sheets("Education Analysis").Select
ActiveWindow.SelectedSheets.Delete
Sheets("CostOver ").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Reclaim").Select
ActiveWindow.SelectedSheets.Delete

My other problem is that I can check all three checkboxes at the same time.
If there any way that I can set it up to only let me check one box and
prevent from checking the other boxes.

Thanks in advance for any help givien.
--
thank you mac
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default check box question

Private Sub CheckBox2_Click()
application.displayalerts = false
Sheets("Education Analysis").Delete
Sheets("CostOver ").Delete
Sheets("Reclaim").Delete
application.displayalerts = true
End Sub

If those sheets may not be there, you may want:

Private Sub CheckBox2_Click()
on error resume next
application.displayalerts = false
Sheets("Education Analysis").Delete
Sheets("CostOver ").Delete
Sheets("Reclaim").Delete
application.displayalerts = true
on error goto 0
End Sub

mac wrote:

Helllo.

I have two problems with my check boxes.

I have created 3 checkboxes on the same worksheet. when I checkbox1 click I
want to delete certain worksheets. When I checkbox2 cliick I want to delete
other sheets. I have set up the macro, but when I click the box I get the
message "data may exist in the sheets selected for deletion. To
permanently delete the data press delete. Is there a way that I do not get
the message and it just deletes the sheets?
This is a part of my code:

Private Sub CheckBox2_Click()
Sheets("Education Analysis").Select
ActiveWindow.SelectedSheets.Delete
Sheets("CostOver ").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Reclaim").Select
ActiveWindow.SelectedSheets.Delete

My other problem is that I can check all three checkboxes at the same time.
If there any way that I can set it up to only let me check one box and
prevent from checking the other boxes.

Thanks in advance for any help givien.
--
thank you mac


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mac Mac is offline
external usenet poster
 
Posts: 213
Default check box question

DAVE,

THANK YOU!!!!!!
--
thank you mac


"Dave Peterson" wrote:

Private Sub CheckBox2_Click()
application.displayalerts = false
Sheets("Education Analysis").Delete
Sheets("CostOver ").Delete
Sheets("Reclaim").Delete
application.displayalerts = true
End Sub

If those sheets may not be there, you may want:

Private Sub CheckBox2_Click()
on error resume next
application.displayalerts = false
Sheets("Education Analysis").Delete
Sheets("CostOver ").Delete
Sheets("Reclaim").Delete
application.displayalerts = true
on error goto 0
End Sub

mac wrote:

Helllo.

I have two problems with my check boxes.

I have created 3 checkboxes on the same worksheet. when I checkbox1 click I
want to delete certain worksheets. When I checkbox2 cliick I want to delete
other sheets. I have set up the macro, but when I click the box I get the
message "data may exist in the sheets selected for deletion. To
permanently delete the data press delete. Is there a way that I do not get
the message and it just deletes the sheets?
This is a part of my code:

Private Sub CheckBox2_Click()
Sheets("Education Analysis").Select
ActiveWindow.SelectedSheets.Delete
Sheets("CostOver ").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Reclaim").Select
ActiveWindow.SelectedSheets.Delete

My other problem is that I can check all three checkboxes at the same time.
If there any way that I can set it up to only let me check one box and
prevent from checking the other boxes.

Thanks in advance for any help givien.
--
thank you mac


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default check box question

hi
1. try this at the start of your code.
application.displayalerts = false
then at the end of your code
application.displayalerts = true
2. you might want to consider options buttons and set the group property as
a group. by default, all options buttons on the sheets are groups as
sheetname.
but.. set up each check box with an if/then/else statement like below. if
you want the one you checked to be true, then programicly uncheck the other
two.
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
CheckBox3 = false
End If
do other stuff
end if
end sub
Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
CheckBox3 = false
End If
do other stuff
end if
end sub

regards
FSt1

"mac" wrote:

Helllo.

I have two problems with my check boxes.

I have created 3 checkboxes on the same worksheet. when I checkbox1 click I
want to delete certain worksheets. When I checkbox2 cliick I want to delete
other sheets. I have set up the macro, but when I click the box I get the
message "data may exist in the sheets selected for deletion. To
permanently delete the data press delete. Is there a way that I do not get
the message and it just deletes the sheets?
This is a part of my code:

Private Sub CheckBox2_Click()
Sheets("Education Analysis").Select
ActiveWindow.SelectedSheets.Delete
Sheets("CostOver ").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Reclaim").Select
ActiveWindow.SelectedSheets.Delete

My other problem is that I can check all three checkboxes at the same time.
If there any way that I can set it up to only let me check one box and
prevent from checking the other boxes.

Thanks in advance for any help givien.
--
thank you mac

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
Question regarding VLookup and if it can check two columns of data Smoke Excel Worksheet Functions 2 September 23rd 08 09:10 PM
Check box logic question Ailsa02 Excel Worksheet Functions 4 August 23rd 08 04:04 PM
Question to check the conditions and then print the result. Neelakanta New Users to Excel 1 June 18th 08 08:15 AM
Increase size of a Forms Check Box (click on to enter check mark) 718Satoshi Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM


All times are GMT +1. The time now is 02:52 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"