View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Toggle Code Calls

Hi Dave,

I am not sure that I understand, but perhaps:

Sub RunCode1()
MsgBox "Code1"
End Sub

Sub RunCode2()
MsgBox "Code2"
End Sub

Sub testoftoggle()
If Date #1/3/2006# = True Then
RunCode2
Else
RunCode1
End If
End Sub


---
Regards,
Norman



"Desert Piranha"
<Desert.Piranha.23yvvz_1141176602.7071@excelforu m-nospam.com wrote in
message news:Desert.Piranha.23yvvz_1141176602.7071@excelfo rum-nospam.com...

Hi all,

If these work, to call macro's:

Sub RunCode1()
Code1
End Sub

Sub RunCode2()
Code2
End Sub

Why dosen't this work, to toggle the calls?
Sub testoftoggle()
If Code1 = True Then
Code2
Else
Code1
End If
End Sub


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:
http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=517572