Hi,
I have a listbox from sheet1 with 7columns. I already linked it on textbox. now, I want to modify the existing listbox and sheet1. also, add new items.
can someone help me? i dont know how to proceed.
tried some scripts but it only update 1 column and duplicate it to other cols.
I have a listbox from sheet1 with 7columns. I already linked it on textbox. now, I want to modify the existing listbox and sheet1. also, add new items.
can someone help me? i dont know how to proceed.
tried some scripts but it only update 1 column and duplicate it to other cols.
VBA Code:
Private Sub CommandButton1_Click()
ListBox1.ColumnCount = "7"
With ListBox1
.RowSource = "sheet1!A2:G200"
.ColumnHeads = True
.ColumnWidths = "80;80;80"
End With
End Sub
Private Sub ListBox1_Click()
Dim i As Long
With Me.ListBox1
i = .ListIndex
Me.TextBox1.Text = .List(i, 0)
Me.TextBox2.Text = .List(i, 1)
Me.TextBox3.Text = .List(i, 2)
Me.TextBox4.Text = .List(i, 3)
Me.TextBox5.Text = .List(i, 4)
Me.TextBox6.Text = .List(i, 5)
Me.TextBox7.Text = .List(i, 6)
End With
End Sub
Last edited by a moderator: