View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trev[_3_] Trev[_3_] is offline
external usenet poster
 
Posts: 6
Default Calling a macro from an If statement

Hi Kathryn,
I believe that your code is looking for the word 'True' in
the cell. True is really minus 1 and false is zero.
I havn't tried it but you could try omitting the speech
marks from around "True" which I think Excel will then
interpret correctly

trev
-----Original Message-----
I want to run a macro based on one or both value(s) of 2
checkboxes else I want to skip the macro. If chkbx1 is
TRUE, I want to skip the macro. If chkbx2 is TRUE, I

want
to skip to skip the macro. If chkbx1 and chkbx2 are both
TRUE, I want to skip the macro.

This is what I have and it is not working (E6 and E7 are
the cells linked to the checkbox controls....

Sub test()
Worksheets("Data").Select
Range("E6").Select
If E6 = "TRUE" Then
Worksheets("Form").Select
Range("A4:I4").Select
ElseIf E7 = "TRUE" Then
Worksheets("Form").Select
Range("A4:I4").Select
Else
mcrSaveAs
End If

End Sub

Thanks for any advice you may have!
.