Hi,

I am using an autofilter to display multiple columns of data from a worksheet in a userform listbox, which works well.
I now want to select a row in the listbox and delete the content from the sheet. The problem I have is that the listbox "row" selected is being taken as an absolute, rather than referencing where the data resides on the worksheet.
For example, selecting the first row on the listbox and deleting will delete row1 of the worksheet, regardless of whether it is part of the autofiltered data. What I need is a relationship between the autofiltered worksheet row number and the logical row numbers in the worksheet. The contents of the listbox is dynamic.

Below is the "delete" code:

Private Sub CommandButton12_Click()

Dim I As Long

With ListBox10
For I = .ListCount - 1 To 0 Step -1
If .Selected(I) Then
.RemoveItem I
Sheets("Sheet1").Rows(I + 2).EntireRow.Delete

End If
Next I

End With
End Sub

Any help much appreciated

Thanks