sharky12345
08-12-2013, 09:06 AM
I'm using the following to select and edit items within a Userform Listbox;
Private Sub CommandButton2_Click()
Dim rCell As Range
With ListBox2
Set rCell = Range(.RowSource).Offset(.ListIndex).Resize(1)
rCell.Value = TextBox1.Value
End With
End Sub
Private Sub ListBox1_Click()
TextBox1.Value = ListBox2.Value
End Sub
I'd like to know please if it is possible to amend the code so that the item it selects and edits is ONLY the one in the 3rd column, I want the values in columns 1 and 2 to remain.
Posted elsewhere too: http://www.mrexcel.com/forum/excel-questions/719695-edit-listbox-items.html
Private Sub CommandButton2_Click()
Dim rCell As Range
With ListBox2
Set rCell = Range(.RowSource).Offset(.ListIndex).Resize(1)
rCell.Value = TextBox1.Value
End With
End Sub
Private Sub ListBox1_Click()
TextBox1.Value = ListBox2.Value
End Sub
I'd like to know please if it is possible to amend the code so that the item it selects and edits is ONLY the one in the 3rd column, I want the values in columns 1 and 2 to remain.
Posted elsewhere too: http://www.mrexcel.com/forum/excel-questions/719695-edit-listbox-items.html