karolina1406
Board Regular
- Joined
- Apr 18, 2016
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
I am using MultiPage in my Userform to update 2 separate Excel tables. I have below code to update first table called "ReservCards " from page 1 called "Cards" and it workds perfectly. How can i improve the code to update my second table called "ReservCables", with the same data but from page 2 called "cables" and my textBoxes are called "cablestype" and "cablequantity"
VBA Code:
Dim oNewRow As ListRow
Dim rng As Range
Set rng = ThisWorkbook.Worksheets("Available_Stock").Range("ReservCards")
rng.Select
Set oNewRow = Selection.ListObject.ListRows.Add(AlwaysInsert:=True)
With ws
oNewRow.Range.Cells(1, 2).Value = Date
oNewRow.Range.Cells(1, 3).Value = Me.cardtype.Value
oNewRow.Range.Cells(1, 4).Value = Me.cardquantity.Value