k13r4n
12-16-2008, 07:26 PM
Hello everyone
I have got stuck trying to pass some information contained within a variable from the sub in which the information is obtained to a function that will process the information.
Basiclly, i have a sub that runs on a button click on a userform that will take some information from a listbox and assign it to a variable, i then want to call a function and in that, use the information in the variable asigned from the sub.
I dont have any problems with the sub or function they all work, i just need to pass the info from one to the other
Striped down Example below
Sub in the userform
Private Sub ImportAll_Click()
Dim Filename
Filename = ListBox1.List(1)
GetFile 'the function im calling
End Sub
Function in a module
Function GetFile()
DoALoadOfStuff = Filename
End Function
I have googled it and searched the forum and the KB but i either cant find what im after or its way to cryptic for me to understand at my current level of understanding (but im getting better :thumb )
So an Idiots guide would be greatly appreciated.
Cheers
Kieran
I have got stuck trying to pass some information contained within a variable from the sub in which the information is obtained to a function that will process the information.
Basiclly, i have a sub that runs on a button click on a userform that will take some information from a listbox and assign it to a variable, i then want to call a function and in that, use the information in the variable asigned from the sub.
I dont have any problems with the sub or function they all work, i just need to pass the info from one to the other
Striped down Example below
Sub in the userform
Private Sub ImportAll_Click()
Dim Filename
Filename = ListBox1.List(1)
GetFile 'the function im calling
End Sub
Function in a module
Function GetFile()
DoALoadOfStuff = Filename
End Function
I have googled it and searched the forum and the KB but i either cant find what im after or its way to cryptic for me to understand at my current level of understanding (but im getting better :thumb )
So an Idiots guide would be greatly appreciated.
Cheers
Kieran