gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
This Code worked and all of a sudden it doesnt. I dont recall making any changes that would have caused it not to work. I dont get an error message. Its just no longer listed the selections from ListBox1 in Column L
Code:
Private Sub CommandButton2_Click()
Range("L1:L200").Select
Selection.ClearContents
'
Dim Msg As String
Dim i As Integer
Dim c As Integer
Dim NextRow As Long
Dim LastRow As Long
Worksheets("Tables").Select
Range("L1").Select
' Determine the next empty row
NextRow = Application.WorksheetFunction. _
CountA(Range("L:L")) + 1
' Transfer the selected items from ListBox
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
c = c + 1
Cells(LastRow + c, 12) = ListBox1.List(i, 0)
End If
Next i
'
' Sheets("Tables").Calculate
End Sub