Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Check Box macro

i am trying to run a macro from a button that is conditional on two check boxes

this is what i have so far;

Sub InitialBUTTON()



If ActiveSheet.CheckBoxes("CheckBox1").Value = True And
ActiveSheet.CheckBoxes("CheckBox2").Value = True Then

YESNO = MsgBox("Create Initial CHR for " &
Sheets("summary").Range("F7").Value & " " & _
Sheets("summary").Range("F8").Value & "?", vbYesNo + vbCritical,
"CHR Set Up")
Select Case YESNO
Case vbYes
Call INITIAL_CHR
Case vbNo
End Select

ElseIf ActiveSheet.CheckBoxes("CheckBox1").Value = True And
ActiveSheet.CheckBoxes("CheckBox2").Value = False Then
MechanicalCHRincomplete.Show

ElseIf ActiveSheet.CheckBoxes("CheckBox1").Value = False And
ActiveSheet.CheckBoxes("CheckBox2").Value = True Then
ElectricalCHRincomplete.Show

ElseIf ActiveSheet.CheckBoxes("CheckBox1").Value = False And
ActiveSheet.CheckBoxes("CheckBox2").Value = False Then CHRincomplete.Show

End If

End Sub


but i cant get it to work?

any help would be much appreciated.

Patrick

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Check Box macro


Sub InitialBUTTON()

If ActiveSheet.CheckBox1.Value = True And _
ActiveSheet.CheckBox2.Value = True Then

YESNO = MsgBox("Create Initial CHR for " & _
Sheets("summary").Range("F7").Value & " " & _
Sheets("summary").Range("F8").Value & "?", vbYesNo + vbCritical, _
"CHR Set Up")
Select Case YESNO
Case vbYes
Call INITIAL_CHR
Case vbNo
End Select

ElseIf ActiveSheet.CheckBox1.Value = True And _
ActiveSheet.CheckBox2.Value = False Then

MechanicalCHRincomplete.Show

ElseIf ActiveSheet.CheckBox1.Value = False And _
ActiveSheet.CheckBox2.Value = True Then

ElectricalCHRincomplete.Show

ElseIf ActiveSheet.CheckBox1.Value = False And _
ActiveSheet.CheckBox.Value = False Then CHRincomplete.Show

End If

End Sub
"Patrick Bateman" wrote:

i am trying to run a macro from a button that is conditional on two check boxes

this is what i have so far;

Sub InitialBUTTON()



If ActiveSheet.CheckBoxes("CheckBox1").Value = True And
ActiveSheet.CheckBoxes("CheckBox2").Value = True Then

YESNO = MsgBox("Create Initial CHR for " &
Sheets("summary").Range("F7").Value & " " & _
Sheets("summary").Range("F8").Value & "?", vbYesNo + vbCritical,
"CHR Set Up")
Select Case YESNO
Case vbYes
Call INITIAL_CHR
Case vbNo
End Select

ElseIf ActiveSheet.CheckBoxes("CheckBox1").Value = True And
ActiveSheet.CheckBoxes("CheckBox2").Value = False Then
MechanicalCHRincomplete.Show

ElseIf ActiveSheet.CheckBoxes("CheckBox1").Value = False And
ActiveSheet.CheckBoxes("CheckBox2").Value = True Then
ElectricalCHRincomplete.Show

ElseIf ActiveSheet.CheckBoxes("CheckBox1").Value = False And
ActiveSheet.CheckBoxes("CheckBox2").Value = False Then CHRincomplete.Show

End If

End Sub


but i cant get it to work?

any help would be much appreciated.

Patrick

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
check box macro Monique Excel Discussion (Misc queries) 1 November 10th 09 05:22 AM
Macro for check box [email protected] Excel Discussion (Misc queries) 2 December 30th 08 08:59 PM
Check Box Macro bjh Excel Discussion (Misc queries) 5 June 24th 08 09:46 PM
check contain value with macro Nadia25 Excel Programming 1 September 27th 05 04:30 AM
Check Box Macro Jason Watts Excel Programming 3 January 7th 04 02:46 AM


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