ndendrinos
Well-known Member
- Joined
- Jan 17, 2003
- Messages
- 1,694
Code:
Sub Match_Row54()
Dim cell As Range, Found As Range, Firstfound As String
Sheets("Invoice").Select
For Each cell In Range("D17:D35")
If Not IsEmpty(cell) Then
Set Found = Rows(54).Find(cell.Value, Cells(54, Columns.Count), xlValues, xlWhole, xlByColumns, xlNext, False)
If Not Found Is Nothing Then
Firstfound = Found.Address
Do
If Found.Offset(3) < 0 Then
Found.Offset(1).Select
UserForm1.Show
End If
Set Found = Rows(54).FindNext(After:=Found)
If Found Is Nothing Then Exit Do
Loop Until Found.Address = Firstfound Or Found Is Nothing
End If
End If
Next cell
End Sub
I use above to edit [B17:B35] thanks to a userform's textbox.
When I get the userform up I edit the first row and the userform disappears instead of staying on in case there is more than one row that needs editing. Is there something missing in the code? I really can't tell
Thank you