PDA

View Full Version : Call upon different procedures?



M0ng00se
01-14-2008, 04:51 PM
How would i call upon other procedures in the module when certain things are true? And also how do i call upon other procedures. For example....



procedure1
...
...
end of procedure2

procedure2
...
...
end of procedure2

If A1 = yes then
Run procedure1
else
run procedure 2
end if

Carl A
01-14-2008, 05:13 PM
Homework?

Sub RunThis1()
MsgBox "Value is more than 100"
End Sub

Sub RunThis2()
MsgBox "Value is less than 100"
End Sub

Sub test()
If Range("A1").Value > 100 Then
Call RunThis1
ElseIf Range("A1").Value < 100 Then
Call RunThis2
End If
End Sub

M0ng00se
01-14-2008, 05:37 PM
Okay, thanks carl :) I got it.

Now, does anyone know how to say

Do until Selection.value (not equal to) "Yes"

Or somethin like that.
Thanks in advance :)

ProteanBeing
01-14-2008, 08:04 PM
do until Selection.value <> "Yes"
.
loop

ProteanBeing
01-14-2008, 08:04 PM
do until Selection.value <> "Yes"
' code
loop

M0ng00se
01-14-2008, 08:05 PM
Got it. Thanks a bunch :)