Hey guys
I have 2 userform text boxes (One that has a username, another has a password) That I want to be passed into excel to equal variables. How would I go about assigning these to variables in VBA for a macro to use?
Hey guys
I have 2 userform text boxes (One that has a username, another has a password) That I want to be passed into excel to equal variables. How would I go about assigning these to variables in VBA for a macro to use?
A very simple example:
![]()
Please Login or Register to view this content.
Regards
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
You could put this in the userform's code module
and code like this in a normal module![]()
Please Login or Register to view this content.
Alternatly, you could put much of the machinery inside the userform code module![]()
Please Login or Register to view this content.
and call it from a normal module. These two subs show different ways of calling the UserAndPassword function.![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
I do not know if I explained it like I wanted to. Here it is again:
I have one Forms.TextBox.1 named Username
I have one Forms.TextBox.1 name Password
How do I take the text in these boxes transfer over to variables that I can use in VBA code?
So in what way do the answers not apply?
Everyone who confuses correlation and causation ends up dead.
I do not think I understand how any of them work.
It might help if you posted a sample workbook showing what you are trying to do, then we could provide specific code with an explanation.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks