Hi guys!
I am facing a problem:
I am using a userform to get data into a spreadsheet.
Now there is a possibility that data which is already in the sheet has to be updated.
Therefore, I use the change procedur that loads the information back into my userform.
But now I am stuck!!
I cant get the new information replacing the old.
Does anyone know how to do this?
Here is the code that I use right now.
Private Sub textbox1_change()
Dim IntY As Integer
IntY = 2
With ThisWorkbook.Worksheets("Tabelle1")
Do Until .Cells(IntY, 1) = ""
If Val(TextBox1) = Cells(IntY, 1) Then
TextBox2 = .Cells(IntY, 2)
TextBox3 = .Cells(IntY, 3)
TextBox4 = .Cells(IntY, 4)
Exit Do
End If
IntY = IntY + 1
Loop
If .Cells(IntY, 2) = "" Then
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
End If
End With
End Sub
AND
private sub cmd_Click
dim inty as integer
with thisworkbook.worksheets("Tabelle1")
inty = 2
do until .cells(inty, 1) = ""
inty = inty +1
loop
.cells(inty, 1) = txtID
.cells(inty, 2)= txtLast
.cells(inty, 3) = txtFirst
.cells(inty, 4) = txtAge
end with
end sub
Help is greatly appreciated!!!!
Tnx Christian
Bookmarks