View Full Version : Simple VB Question


phillsheen
06-29-2008, 11:59 PM
Morning!
I remember doing something like this in college years ago but I have no idea what its called to search for it.
I have a piece of code that I want to repeat a few times but I dont want to just copy the code 4 times over. I would like to know what its called when you write the code you want then call that code up with a simple line of text.

Any help would be great!

Phill

namliam
06-30-2008, 01:42 AM
It is called a sub-function or sub-procedure...

It works like so:
Sub Main
JustSayHello
JustSayHello
JustSayHello
msbbox "==> Bye"
end sub

sub JustSayHello
MsgBox "just"
MsgBox "say"
MsgBox "Hello"
end sub