bradystreet212
New Member
- Joined
- Feb 29, 2012
- Messages
- 5
I've been working on a userform so I can input multiple values all at once instead of the annoying input box that pops up a hundred times a day. I'm not sure whats needs done to transfer the input data into my module so that my macro can recognize what the user has put in the text boxes.
Module:
sub test()
load userform
userform.show
end sub
sub MainSub(byref c1 as string, byref c2 as integer)
dim CoFr as string, CoTo as integer
CoFr = c1
CoTo = c2
end sub
UserForm:
public Var1 as string, Var2 as integer
sub CmdOK()
Var1 = userform.textbox1.text
Var2 = userform.textbox2.value
Call MainSub(Var1, Var2)
unload userform
end sub
this is how I'm approaching it but I don't think its right? is there another step or a different way to approach this? declaring variables a different way, adding another sub add() or something.
Module:
sub test()
load userform
userform.show
end sub
sub MainSub(byref c1 as string, byref c2 as integer)
dim CoFr as string, CoTo as integer
CoFr = c1
CoTo = c2
end sub
UserForm:
public Var1 as string, Var2 as integer
sub CmdOK()
Var1 = userform.textbox1.text
Var2 = userform.textbox2.value
Call MainSub(Var1, Var2)
unload userform
end sub
this is how I'm approaching it but I don't think its right? is there another step or a different way to approach this? declaring variables a different way, adding another sub add() or something.