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.
Bookmarks