Get Variable so other Sub can use?

  • Thread starter Thread starter Sue Mosher [MVP-Outlook]
  • Start date Start date
S

Sue Mosher [MVP-Outlook]

The easiest method probably is to make MyDateInfo a Function instead of a Sub and return the value:

Sub MainProf()
myDate = MyDateInfo()
End Sub

Function MyDateInfo()
Dim strDateText As String
strDateText = Date
MyDateInfo = strDateText
End Function
 
Can someone help me with the following.
The following little macro puts the date varable trDateText
How do I pass the variable from MyDateInfo to MainProg so i can use it
there. Both are in separate modules.
I'm using Outlook 2000 On windows 2000

Sub MyDateInfo()

Dim strDateText As String
strDateText = Date

End Sub
---------------------
Sub MainProg()

Other code ....
'run the MyDateInfo
MyDateInfo
Use variable strDateText from MyDateInfo
Other code ....
End Sub
 
Thats great.
Thank you very much.


The easiest method probably is to make MyDateInfo a Function instead of a
Sub and return the value:

Sub MainProf()
myDate = MyDateInfo()
End Sub

Function MyDateInfo()
Dim strDateText As String
strDateText = Date
MyDateInfo = strDateText
End Function
 
Back
Top