Just so you know : I have been back to square 1 with everything on my computer. A very huge power surge played havoc on numerous things electric in our neighbourhood, including my computer, its HD and external backup HD that happened just then to be connected. And yes, in spite of an apparently useless surge protector. Had to spend every free second to recover what still could be recovered. Back to business.
Question : How can I pass a variable to a module?
Some of you will remember my post on how to store data within an application (programme?) and building on a suggestion from Bruce, I put my data in a module like this :
' Module DataCloset
x As Integer
NamesStr$ As String
Public Sub Data() As String
' Receive a value for x from Button1_Click() ???
x = 2 'just an example
Select Case x
Case 1
NamesStr$ = "John,Michael,Harry,Liam,William,Oliver,James,Peter"
Case 2
NamesStr$ = "Isabelle,Yvonne,Mary,Patricia,Olivia,Emma,Eve,Amalia,Petra,Fleur"
Case 3
NamesStr$ = "Fido,Tiger,Bella,Ginger,Momo,Chibi"
End Select
Return NamesStr$
End
In Fmain I have a Button that should retrieve the list I want (just for now, later to be replaced by a proper choose routine.)Public Sub Button1_Click()
'Here I would like to send the list number to module DataCloset
‘before it returns the data.
NamesList = Split(DataCloset.Data(), ",", " ", True)
‘followed by the rest of the code
End