Good day
I have the following problem:
I have a list of sample ID's in a table and the user wants to edit the entries for each ID whenever he needs to. So lets say for example that one ID is A0225. The user wants to edit the column "Yield Strenght" from his UserForm. He clicks on the button edit table and the column "Yield Strength" is updated.
My code behind the userform looks like this at the moment:
Dim lstObj As ListObject
Dim objNewRow As ListRow
Dim i As Integer
Dim ID As ListObject
Dim tbl As ListObject
Dim tRows As Long
Dim tCols As Long
Dim ptr As LongPtr
Set Obj = Worksheets("Tests Results").ListObjects("Test_results")
'count rows
Set tbl = Worksheets("Tests Results").ListObjects("Test_results")
With tbl.DataBodyRange
tRows = .Rows.Count
End With
For i = 1 To tRows
If obj = Me.SampleID.value Then
Set objNewRow = lstObj.ListRows.Change(AlwaysInsert:=True)
With Obj
.ListColumns("Yield Strength").DataBodyRange(x) = Me.Yield.Value
end with
end if
Bookmarks