R
Rick S.
If the Dim "sUserPart" has no match in column A, how do I capture that? I
would like to prompt the user with a MsgBox.
Everything I have come up with itterates thru all the cells.
'======
With Sheets("Part Number")
Sh1LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set Sh1Range = .Range("A1:A" & Sh1LastRow)
End With
For Each Sh1Cell In Sh1Range
If Sh1Cell.Value = sUserPart Then
MsgBox "do some stuff here"
Else
MsgBox "Not found!" 'loops thru all cells in range?
End If
'======
--
Regards
VBA.Noob.Confused
XP Pro
Office 2007
would like to prompt the user with a MsgBox.
Everything I have come up with itterates thru all the cells.
'======
With Sheets("Part Number")
Sh1LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set Sh1Range = .Range("A1:A" & Sh1LastRow)
End With
For Each Sh1Cell In Sh1Range
If Sh1Cell.Value = sUserPart Then
MsgBox "do some stuff here"
Else
MsgBox "Not found!" 'loops thru all cells in range?
End If
'======
--
Regards
VBA.Noob.Confused
XP Pro
Office 2007