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

I am trying to stop someone from continuing if they select 2 different
checkboxes until one of them are unchecked, I have been playing with this
and haven't got it to work,what are your thoughts other than me finding a
new job

Private Sub CheckBox2_Change()
Dim wksh As Worksheet
Set wksh = Worksheets("jan")
If CheckBox2.Value = True Then
If CheckBox6.Value = True Then
Stop
MsgBox "Please Uncheck Either Plant or Construction Before Proceeding"
Else
For i = 1 To 12
sname = Choose(i, "jan", "feb", "march", "april", "may", _
"june", "july", "aug", "sept", "oct", "nov", "dec")

Set wksh = Worksheets(sname)
wksh.Unprotect ("?")
wksh.Range("v10") = Me.CheckBox2.Value
wksh.Protect ("?")
Next
End If
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Stop Problem

David,

Try this:

Private Sub CheckBox2_Change()
Dim wksh As Worksheet
Set wksh = Worksheets("jan")
If CheckBox2.Value = True AND CheckBox6.Value = True Then
MsgBox "Please Uncheck Either Plant or Construction Before Proceeding"
Exit Sub
Else
For i = 1 To 12
sname = Choose(i, "jan", "feb", "march", "april", "may", _
"june", "july", "aug", "sept", "oct", "nov", "dec")

Set wksh = Worksheets(sname)
wksh.Unprotect ("?")
wksh.Range("v10") = Me.CheckBox2.Value
wksh.Protect ("?")
Next
End If
End Sub

John

David W wrote:

I am trying to stop someone from continuing if they select 2 different
checkboxes until one of them are unchecked, I have been playing with this
and haven't got it to work,what are your thoughts other than me finding a
new job

Private Sub CheckBox2_Change()
Dim wksh As Worksheet
Set wksh = Worksheets("jan")
If CheckBox2.Value = True Then
If CheckBox6.Value = True Then
Stop
MsgBox "Please Uncheck Either Plant or Construction Before Proceeding"
Else
For i = 1 To 12
sname = Choose(i, "jan", "feb", "march", "april", "may", _
"june", "july", "aug", "sept", "oct", "nov", "dec")

Set wksh = Worksheets(sname)
wksh.Unprotect ("?")
wksh.Range("v10") = Me.CheckBox2.Value
wksh.Protect ("?")
Next
End If
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Stop Problem

Instead of using checkboxes, how about optionbuttons. If they're grouped
nicely, you select one, it unselects the other.

David W wrote:

I am trying to stop someone from continuing if they select 2 different
checkboxes until one of them are unchecked, I have been playing with this
and haven't got it to work,what are your thoughts other than me finding a
new job

Private Sub CheckBox2_Change()
Dim wksh As Worksheet
Set wksh = Worksheets("jan")
If CheckBox2.Value = True Then
If CheckBox6.Value = True Then
Stop
MsgBox "Please Uncheck Either Plant or Construction Before Proceeding"
Else
For i = 1 To 12
sname = Choose(i, "jan", "feb", "march", "april", "may", _
"june", "july", "aug", "sept", "oct", "nov", "dec")

Set wksh = Worksheets(sname)
wksh.Unprotect ("?")
wksh.Range("v10") = Me.CheckBox2.Value
wksh.Protect ("?")
Next
End If
End Sub


--

Dave Peterson

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
How stop the "started office live" pop-up to stop. it is checked yrose24 Excel Discussion (Misc queries) 1 September 2nd 09 03:32 PM
To Stop or Not to Stop BillCPA Excel Discussion (Misc queries) 0 June 22nd 06 03:41 PM
Stop (C) becoming © fullers Excel Discussion (Misc queries) 2 May 3rd 06 11:16 AM
How do I stop other circles in other cells to stop selecting? stauff Excel Worksheet Functions 2 October 29th 04 09:02 PM
How do I stop other circles in other boxes to stop selecting? stauff Excel Worksheet Functions 1 October 28th 04 10:27 PM


All times are GMT +1. The time now is 01:39 AM.

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"