+ Reply to Thread
Results 1 to 23 of 23

Help with Userform textbox value, vlookup, copy to clipboard

  1. #1
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Help with Userform textbox value, vlookup, copy to clipboard

    sample dbase - Copy.xlsm

    I'm working on this project and this how it works.

    the form consist of several text boxes. data is required for each textboxes
    Add to dB will insert all data entered in "DB PIT" sheet. (Its already working)

    now, here is what I'm trying to achieve
    1. I want to have one value on a textbox (as I enter it) to be the same with another textbox.
    2. Since all data are saved on DB PIT sheet, I want to gather data using 2 criteria, 1 is by TIN (first text box) and another is by Hub ID. As soon as I enter the TIN or Hub ID, the rest of the data will be populated on each text boxes if it already exists on the "DB PIT" Sheet.
    3. Lastly, There is a big text box on the lower right, I want to put a template on that area where all the data that I put in will be reflected on that textbox, once all the data is completed, it can easily be copied by just pressing the copy to clipboard button.

    Thank you Guys!

  2. #2
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    anyone please?

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hello etuckram,

    This code assumes the name of the button on the user form is "Command Button 1". You can copy the code between the Sub and End Sub statements into your button's click event. Change the TextBox to match yours.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Quote Originally Posted by Leith Ross View Post
    Hello etuckram,

    This code assumes the name of the button on the user form is "Command Button 1". You can copy the code between the Sub and End Sub statements into your button's click event. Change the TextBox to match yours.
    Please Login or Register  to view this content.
    thank you! It works perfect!

    1. I want to have one value on a textbox (as I enter it) to be the same with another textbox. - SOLVED

    2. Since all data are saved on DB PIT sheet, I want to gather data using 2 criteria, 1 is by TIN (first text box) and another is by Hub ID. As soon as I enter the TIN or Hub ID, the rest of the data will be populated on each text boxes if it already exists on the "DB PIT" Sheet.
    3. Lastly, There is a big text box on the lower right, I want to put a template on that area where all the data that I put in will be reflected on that textbox, once all the data is completed, it can easily be copied by just pressing the copy to clipboard button. - SOLVED

  5. #5
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Additional:

    In Vba,

    on txtbox1, when I enter abcdef111.company.com on that textbox1 it will return with a result on textbox2 with company.com

    so basically it will remove the character after the first "."
    this is what I have on excel, "=RIGHT(B17,LEN(B17)-SEARCH(".",B17))"

    what is the equivalent of that in VBA?

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hello etuckram

    Her is one way...
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Quote Originally Posted by Leith Ross View Post
    Hello etuckram

    Her is one way...
    Please Login or Register  to view this content.
    it says, subscript out of range

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hello etuckram,

    You would get that error message if the TextBox1 is empty.

  9. #9
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Quote Originally Posted by Leith Ross View Post
    Hello etuckram,

    You would get that error message if the TextBox1 is empty.
    as soon as I type a Letter on textbox1, it will give me that error.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hello etuckram.

    You should be validating the entry after it has been entered and not during entry. Move the code from the Change event to the Click event.

  11. #11
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Quote Originally Posted by Leith Ross View Post
    Hello etuckram.

    You should be validating the entry after it has been entered and not during entry. Move the code from the Change event to the Click event.
    Please Login or Register  to view this content.
    it gave me the same value

  12. #12
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    also, can we write a code that would ignore the word if no "." period was found?

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hllo etuckram,

    You need only the AfterUpate event code. Remove the other event code modules for this TextBox.
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    it works now....

    also, can we write a code that would ignore the word if no "." period was found?

  15. #15
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    it perfectly works now, the problem is
    when i enter
    word.marky.domain.com, the return is domain.com
    I just want to remove the first word before the first dot.

  16. #16
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hello etuckram,

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Quote Originally Posted by Leith Ross View Post
    Hello etuckram,

    Please Login or Register  to view this content.
    I appreciate your help, but its not working, its giving me the same value

  18. #18
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hello etuckram,

    What should the before and after values look like?

  19. #19
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    txtOut = mmmm1.marky.company.com
    txtDomain = marky.company.com

    If I enter mmmm1.marky.company.com, I will get marky.company.com on txtDomain

  20. #20
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hello etuckram,

    This produces the correct result for me...
    Please Login or Register  to view this content.

  21. #21
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Quote Originally Posted by Leith Ross View Post
    Hello etuckram,

    This produces the correct result for me...
    Please Login or Register  to view this content.
    Thank you, I'm almost there....

    1. I want to have one value on a textbox (as I enter it) to be the same with another textbox. - SOLVED
    2. Since all data are saved on DB PIT sheet, I want to gather data using 2 criteria, 1 is by TIN (first text box) and another is by Hub ID. As soon as I enter the TIN or Hub ID, the rest of the data will be populated on each text boxes if it already exists on the "DB PIT" Sheet.
    3. Lastly, There is a big text box on the lower right, I want to put a template on that area where all the data that I put in will be reflected on that textbox, once all the data is completed, it can easily be copied by just pressing the copy to clipboard button. - SOLVED

  22. #22
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    Hi Everyone,

    I'm currently working on a User Form in Excel. I'm almost done with it I just need one last piece of info.

    This Userform consists of textboxes
    ex:
    txtbox1
    txtbox2
    txtbox3
    txtbox4
    txtbox5

    now, initially you would enter any value on each textbox then there is button on that userform that would past all the information on a sheet name "Database"

    now, what I want to happen is to automatically populate values of txtbox 2 to 5 if the value of txtbox1 was recently added to the "database" sheet. If no matches found, then just add the assigned date as the date today like what I have on my code.

    This is my code and it is not working...

    Please Login or Register  to view this content.
    Please help... Thank you

  23. #23
    Registered User
    Join Date
    12-08-2010
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    76

    Re: Help with Userform textbox value, vlookup, copy to clipboard

    This worked for me:
    copy textbox value to clipboard
    Please Login or Register  to view this content.


    Additional:

    In Vba,

    on txtbox1, when I enter abcdef111.company.com on that textbox1 it will return with a result on textbox2 with company.com

    so basically it will remove the character after the first "."
    this is what I have on excel, "=RIGHT(B17,LEN(B17)-SEARCH(".",B17))"

    what is the equivalent of that in VBA?




    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1