LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Find, FindNext and prompt user to delete

I'm trying to figure out how to use entries entered into a userform to
perform a find, then prompt the user to delete the row. If yes, then
delete if no, find the next match. Here's the code I have so far:

Private Sub cmdFindDel_Click()
Sheets("Event Request Master List").Select

Dim RowIndex As Integer
Dim chkEventDate As Date
Dim chkReqDate As Date
Dim chkRequestor As String

Dim FindEventDate As String
Dim FindReqDate As String
Dim FindRequestor As String
Dim FindDept As String
Dim FindTeams As String
Dim FindStartTime As String
Dim FindEndTime As String
Dim FindDescrip As String
Dim FindEnvir As String
Dim FindApps As String
Dim FindCMR As String

RowIndex = 2
chkEventDate = Format(Me.txtEventDate.Value, "mm/dd/yy")
chkReqDate = Format(Me.txtReqDate.Value, "mm/dd/yy")
chkRequestor = Me.txtRequestor.Value

If chkEventDate = "12:00:00 AM" Then
MsgBox "Please enter the Event Date.", vbOKOnly
ElseIf chkReqDate = "12:00:00 AM" Then
MsgBox "Please enter the Requested Date.", vbOKOnly
ElseIf chkRequestor = "" Then
MsgBox "Please enter the Requestor name.", vbOKOnly
End If

Do Until Range("A" & RowIndex).Value = ""

If Format(Range("a" & RowIndex).Value, "mm/dd/yy") = chkEventDate
Then
If Format(Range("b" & RowIndex).Value, "mm/dd/yy") = chkReqDate
Then
If Range("c" & RowIndex).Value = chkRequestor Then
'populate the form with the data
Me.txtFindEventDate.Text = Range("A" & RowIndex).Value
Me.txtFindReqDate.Text = Range("B" & RowIndex).Value
Me.txtFindRequestor.Text = Range("C" & RowIndex).Value
Me.txtFindDept.Text = Range("D" & RowIndex).Value
Me.txtFindTeams.Text = Range("E" & RowIndex).Value
Me.txtFindStartTime.Text = Range("F" & RowIndex).Value
Me.txtFindEndTime.Text = Range("G" & RowIndex).Value
Me.txtFindDescrip.Text = Range("H" & RowIndex).Value
Me.txtFindEnvir.Text = Range("I" & RowIndex).Value
Me.txtFindApps.Text = Range("J" & RowIndex).Value
Me.txtCMR.Text = Range("K" & RowIndex).Value

Range("A" & RowIndex).Select

Exit Sub

End If
Else
RowIndex = RowIndex + 1
End If
Else
RowIndex = RowIndex + 1
End If


Loop

End Sub


The code finds the first entry and populates the userform just fine,
but I can't figure out how to find the next match if the user doesn't
want to delete the first match....????

Shelley

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Find & FindNext in a form BernzG[_13_] Excel Programming 3 August 19th 05 12:28 AM
Nesting Find and FindNext SA3214 Excel Programming 7 August 10th 05 08:23 PM
Using 'Find' and 'FindNext' in vba SA3214 Excel Programming 3 March 25th 05 12:17 PM
Find...FindNext Problem mtsark Excel Programming 4 August 19th 04 04:09 PM


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"