Results 1 to 4 of 4

Textbox update with previous selection from listbox

Threaded View

Binsy Textbox update with previous... 04-27-2010, 09:40 PM
royUK Re: Textbox update with... 04-28-2010, 01:33 AM
Binsy Re: Textbox update with... 04-28-2010, 12:59 PM
Binsy Re: Textbox update with... 04-29-2010, 05:03 PM
  1. #1
    Registered User
    Join Date
    04-27-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Textbox update with previous selection from listbox

    Hi All,

    First let me say that I know nothing about VBA programming but I am trying to develop a userform as a dashboard for an automatic script generator that I made.
    A user supposed to select an object from a listbox which will update the excel database sheet. Excel will then perform various lookup and return all the revelant scripts for this object in a new line of the same sheet, just over 100 lines. I am trying to implement a interface with a userform but the information that got updated in the textbox (result of the lookup for the object selected) is for the previous object selected and not the current.
    I try to use very little code to achieve this as I am not familiar with VBA. The code that I used are shown below. Can someone help me to get the information in the textbox updated for the current selected object in the listbox?

    This is an example that only print 2 lines of information from my excel sheet
    Private Sub ListBox1_Click()
    
    Call TextBox2_Change
    
    End Sub
    
    Private Sub TextBox2_Change()
    
    Me.TextBox2.Value = Cells(16, 2) & vbCrLf & Cells(17, 2)
    End Sub
    I suspect what is happening is that when the user click on the desired object then the userform update the textbox with the data that is in excel at the time of the click and not the new object selected by the click. Is there a way to work around this?

    Any help is apreciated.

    Thanks a lot.
    Last edited by Leith Ross; 04-27-2010 at 09:58 PM. Reason: Addded Code Tags

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