+ Reply to Thread
Results 1 to 11 of 11

Populate spreadsheet cell with data from textbox without using a cmdbutton

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Populate spreadsheet cell with data from textbox without using a cmdbutton

    Hi there,

    I have an Excel spreadsheet with a userform with 5 textboxes.

    I need to insert a value in Textbox1 and it must populates cell A1 in the spreadsheet

    I have other 4 cells in the spreadsheet that are populated with vlookups formulas based on the information in cell A1

    Then i need to populate the remaining 4 textboxes in the userform with the data in the 4 cells in the spreadsheet

    All of this without using a cmdbutton. Meaning i just need to insert different data in textbox1 to change the other 4

    Can anyone help me?

    I've attached my WB
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    Set the ControlSource property of TextBox1 to A1, or whatever cell you want the value from the textbox to goto, eg D3 as it appears to be in the attached workbook.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    I've done that. Tanks, but teh data from cells D5 to D11 doesnīt populate the remaining 4 textboxes.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    It worked for me, what value are you entering in the textbox?

    Can you see that value in the correct cell on the worksheet after you've left the textbox?

  5. #5
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    Any value. Try 900. It populates cell D3 and the formulas in cells D5, D7, D9 and D11 are working fine. But then, the data in those cells should populate textboxes 2 threw 5 and that isn't working.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    You need to set the ControlSource for the other texboxes too.

  7. #7
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    But if i do that it eliminates the spreadsheet formulas...I canīt seem to find a way out.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    Do the formulas in code.

  9. #9
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    Norie, Thanks in advance. I've found that if i close the userform, and then open it again, the information is correct. However, i need the information to update automaticaly when i change data in textbox1 without having to close de userform. is this possible?

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    Instead of using ControlSource you could use one of the events of TextBox1.

    For example the Exit event.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: Populate spreadsheet cell with data from textbox without using a cmdbutton

    Fantastic. It works great. Thanks a lot Norie.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 15
    Last Post: 10-27-2014, 08:45 PM
  2. [SOLVED] Pre-populate TextBox with cell entries for each row
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-19-2014, 09:18 AM
  3. [SOLVED] Repeatedly click a cmdButton to populate a TextBox with different cell values
    By LordBucketHead in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-26-2013, 03:22 PM
  4. Excel VBA Help On Textbox,Cmdbutton to Move Data
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 07:35 AM
  5. [SOLVED] UserForm TextBox and ComboBox selections populate SPECIFIC spreadsheet cells
    By ZIXILPLIX in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-23-2010, 02:45 AM

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