I have a UserForm set up to perform a search across multiple sheets in a workbook. Once the search has been made, a listbox is populated with the results including five columns of data for each item's row.
I have it set up where an item or multiple of items from this list can be selected and then inserted into the worksheet.
At this time, I can bring the information into the active cell however, instead of pushing down the rows, it will cover over top of information in lower cells.
Here is the code:
Private Sub InsertSelected_Click()
Dim iListCount As Long
Dim iColCount As Long
Dim iRow As Integer
Dim j As Long
ActiveCell.Offset(0, -2).Select
For iListCount = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(iListCount) Then
ListBox1.Selected(iListCount) = False
iRow = iRow + 1
For iColCount = 0 To ListBox1.ColumnCount - 1
ActiveCell(iRow, iColCount + 1).Value = _
ListBox1.List(iListCount, iColCount)
Next iColCount
End If
Next iListCount
ActiveCell.Offset(iRow, 0).Select
Unload UserForm1
End Sub
I am just sure i need the following items in there somewhere, but I just can't get it to work:
ActiveCell.EntireRow.Insert
Bookmarks