Hi,
I have a listbox how can make the textbox able to edit the text on the form the code i have is this:
Thank you,
I have a listbox how can make the textbox able to edit the text on the form the code i have is this:
VBA Code:
Private Sub ListBox_Results_Click()
'Go to selection on sheet when result is clicked
Dim strAddress As String
Dim l As Long
For l = 0 To ListBox_Results.ListCount
If ListBox_Results.Selected(l) = True Then
strAddress = ListBox_Results.List(l, 1)
ActiveSheet.Range(strAddress).Select
'Populate textboxes with results
With ActiveSheet
COGSform_All.TextBox_Results1.Value = .Cells(.Range(strAddress).Row, 2).Value
COGSform_All.TextBox_Results2.Value = .Cells(.Range(strAddress).Row, 3).Value
COGSform_All.TextBox_Results3.Value = .Cells(.Range(strAddress).Row, 13).Value
COGSform_All.TextBox_Results4.Value = .Cells(.Range(strAddress).Row, 10).Value
COGSform_All.TextBox_Results5.Value = .Cells(.Range(strAddress).Row, 14).Value
COGSform_All.TextBox_Results6.Value = .Cells(.Range(strAddress).Row, 4).Value
COGSform_All.TextBox_Results8.Value = .Cells(.Range(strAddress).Row, 5).Value
COGSform_All.TextBox_Results9.Value = .Cells(.Range(strAddress).Row, 6).Value
COGSform_All.TextBox_Results10.Value = .Cells(.Range(strAddress).Row, 11).Value
COGSform_All.TextBox_Results11.Value = .Cells(.Range(strAddress).Row, 12).Value
COGSform_All.TextBox_Results12.Value = .Cells(.Range(strAddress).Row, 8).Value
COGSform_All.TextBox_Results13.Value = .Cells(.Range(strAddress).Row, 15).Value
COGSform_All.TextBox_Results14.Value = .Cells(.Range(strAddress).Row, 16).Value
COGSform_All.TextBox_Results15.Value = .Cells(.Range(strAddress).Row, 9).Value
COGSform_All.TextBox_Results16.Value = .Cells(.Range(strAddress).Row, 7).Value
COGSform_All.TextBox_Results17.Value = .Cells(.Range(strAddress).Row, 1).Value
End With
GoTo EndLoop
End If
Next l
EndLoop:
End Sub
Thank you,