It's OK, the code is working now.
Thanks to PHV!! It wasn't so hard to find or do I have to say MATCH?!!
This is the working code:
Private Sub Aanpassen_Click()
x = Application.Match(ComboBox1.Text, Range("A:A"), 0)
ActiveSheet.Range("B:B").Cells(x) = TextBox1.Value
MsgBox "Uurloon...
I was tinking that this should be working, but it isn't:
Private Sub Aanpassen_click()
Dim x As Variant
x = Application.Match(Naam, Uurlonen.Range("A:A"), 0)
Sheets("Uurlonen").Cells(x, "B").Value = TextBox1.Value
Unload frmUurlonen
End Sub
It gives me an error 424.
x gives me...
It is because I do this for a friend. He doesn't know anything about excel.
So I've made some userforms for him so that he only have to use these.
Everything went OK, only for this one.
This isn't working also:
Private Sub Aanpassen_click()
Target = Application.VLookup(ComboBox1.Text, _
Worksheets("Uurlonen").Range("$A:$B"), 2, False)
Target = TextBox1.Value
Unload frmUurlonen
End Sub
example:
Row Colum A ColumB
1 Sebastien 14
2 Bart 14
3 Alex 16
4 Tom 20
5 Tim 16
6 Tia 20
I open the form, and select in Combobox1 the client Tom.
In Textbox1 I get (with vlookup) the value 20.
But I want...
So now I have this for commandbutton2:
Private Sub Aanpassen_click()
lRow = Application.VLookup(ComboBox1.Text, _
Worksheets("Uurlonen").Range("$A:$B"), 2, False)
Sheets("Uurlonen").Cells(lRow, "B").Value = TextBox1.Text
Unload frmUurlonen
End Sub
But there is nothing changing...
I ve already looked it up, but I really don't know how to do it. I'm looking to it for about 4 days now, so I think I put enough effort in it.
Is it this that you mean?
= CELL("address",INDEX(A1:A5,MATCH(MIN(ABS(A1:A5-15)),ABS(A1:A5-15),0)))
But I don't know how to use it in my project.
Textbox1 gives the pay rate (in colum B) of the selected client (in colum A) in combobox1.
This code works. But what I want to do: is that if I change the pay rate manualy in textbox1 and I click on commandbutton2, the pay rate in colum B an row?? is changed to the value I put in textbox1.
I've a sheet ('Uurlonen')
Colum A are the names of the clients
Colum B are the pay rates of that client
I've a commandbutton on the sheet, when I click on it, it opens form frmUurlonen
In this form I've 1 Combobox, 1 textbox and 2 commandbuttons
Combobox1 is a list of the clients
Textbox1 gives...
Yes, I know. But I'm a fysiotherapist and not a programmer. That's why I ask my question here.
I'm trying but no luck. So if you can help me, it's appreciated.
Thanks,
After several hours of looking around, I've now this code.
Code:
Private Sub ComboBox1_Click()
TextBox1.Text = Application.VLookup(ComboBox1.Text, _
Worksheets("Uurlonen").Range("A2:B75"), 2, False)
End Sub
With this code I get the result in Textbox1 after I make a selection...
Hello,
I want to make a form with 2 textboxes and 2 commandbuttons.
The first textbox has to refer to te cellname Naam on the first sheet of the workbook. In the second textbox there wil be the result (with vlookup in the second row of the sheet) of the first textbox. The firts commandbutton is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.