• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to enter a value in VBA code using listBox

Hello,

Recently @Debraj helped me to add a range into a listbox. Now I looking for some help to enter the user feed value into the VBA code. Say, if user is entering an email id, that should be captured in another macro and run that module. Please let me know if you need more information. Is it woks the same way how an input box works? Please help

Please check the attached file. I have included more details there.

Thanks,
Karthik
 

Attachments

  • Range in a userform.xlsm
    29.6 KB · Views: 3
Hi.. karthik

You can do this by referencing the varaibles.. like if you have email address text box, to capture the mail address which the user entered, you can declare a variable like dim EmailAddr as string and capture the text box value.

more or less same.. below. Here we instruct text box that, after the user input completed, then please assign that value to variable namely emailaddr. Same as for another also.. I hope you can understand

Code:
Private Sub txtEmailAddr_AfterUpdate()
    emailAddr = txtEmailAddr.Value
End Sub
 
Back
Top