Hello,
I have an inventory Sheet going in which I use 2 separate Userforms to "Add New" or "Replace Equipment". On the Replace Equipment userform, I have a series of text boxes that are used to filter the data in the worksheet to the point that only one row is showing when the "filter" cmd is clicked. At which point, I use another series of text boxes to replace cells in that row.

Below is the code I have so far to replace the data. I just cannot figure out how to define "iRow" as the row that is shown after the data is filtered. (with my filtering method there will never be more than one row showing once the data is filtered).

Is there a way to do this?



Private Sub CmdReplace_Click()
Cells.EntireRow.Hidden = False

'copy the data to the database
ws.Cells(iRow, 1).Value = Me.TxtType.Value
ws.Cells(iRow, 2).Value = Me.TxtMake.Value
ws.Cells(iRow, 3).Value = Me.TxtModel.Value
ws.Cells(iRow, 4).Value = Me.TxtSN.Value
ws.Cells(iRow, 5).Value = Me.TxtManDate.Value
ws.Cells(iRow, 6).Value = Me.CboBuild.Value
ws.Cells(iRow, 7).Value = Me.TxtRoom.Value

'clear the data
Me.CboBuild.Value = ""
Me.TxtRoom.Value = ""
Me.TxtType.Value = ""
Me.TxtSN.Value = ""
Me.TxtRoom.SetFocus

End Sub