VBA: issue filling textbox based on a combobox
Solved
clemsz
-
clemsz -
clemsz -
Hello everyone,
I am a beginner in VBA and I'm turning to you hoping to get some help.
So I have a little problem that I think will seem quite simple to you but is personally complicating my work a lot...
Let me explain:
I have a userform that contains a combobox1 and a textbox1.
In my combobox1 are dates (of type 01/01/2014... etc) that correspond to the payment date of the loan installments.
I would like my textbox1 to display the value of the remaining capital (column J) based on the selected date.
I entered this formula:
Private Sub ComboBox1_Change()
Dim range As Range
'Sheets("Tableau Seul").Select
Set range = Sheets("Tableau Seul").Range("K14:K100")
range.Select
e = range.Row
TextBox1 = Sheets("Tableau Seul").Range("J" & e).Value
End Sub
But the problem is that the value appearing in the textbox remains the same (the one from my cell J14), even when I change the date... I think the error comes from my last 2 lines with the "e" but I can't figure out where it goes wrong...
I can eventually send my Excel file if I haven't been clear enough!
So if someone has a solution or a correction to propose, I would be very grateful!
Thank you in advance,
Best regards
I am a beginner in VBA and I'm turning to you hoping to get some help.
So I have a little problem that I think will seem quite simple to you but is personally complicating my work a lot...
Let me explain:
I have a userform that contains a combobox1 and a textbox1.
In my combobox1 are dates (of type 01/01/2014... etc) that correspond to the payment date of the loan installments.
I would like my textbox1 to display the value of the remaining capital (column J) based on the selected date.
I entered this formula:
Private Sub ComboBox1_Change()
Dim range As Range
'Sheets("Tableau Seul").Select
Set range = Sheets("Tableau Seul").Range("K14:K100")
range.Select
e = range.Row
TextBox1 = Sheets("Tableau Seul").Range("J" & e).Value
End Sub
But the problem is that the value appearing in the textbox remains the same (the one from my cell J14), even when I change the date... I think the error comes from my last 2 lines with the "e" but I can't figure out where it goes wrong...
I can eventually send my Excel file if I haven't been clear enough!
So if someone has a solution or a correction to propose, I would be very grateful!
Thank you in advance,
Best regards
quick and efficient response ;)
wish you all the best!