I am in the beginning stages of coding together an excel project to search and find specific data. I introduced my first WHILE statement and now I get a message box that says: "RUN-TIME Error '1004' Application-Defined or Object-Defined Error"
Here is my code:
Any ideas?
Sorry if i did not post correctly, I am new to this and hope I tagged my code correctly.
Here is my code:
Code:
Private Sub CommandButton1_Click()
Dim strNumEntry As String
If Sheet1.RMANumOption.Value = True Then
strNumEntry = Sheet1.TextBox1.Text
Sheet1.TextBox2.Text = strNumEntry
Dim intRowCount As Integer
Dim intRowNum As Integer
Dim intColNum As Integer
intRowNum = 1
intColNum = 0
intRowCount = Sheet3.UsedRange.Rows.Count
While intRowNum <= intRowCount
If Sheet1.TextBox1.Text = Sheet3.Cells(intRowNum, intColNum).Value Then
Sheet1.TextBox2.Text = "Found It"
intRowNum = intRowCount + 1
Else
intRowNum = intRowNum + 1
End If
Wend
ElseIf Sheet1.HISSNOption.Value = True Then
strNumEntry = Sheet1.TextBox1.Text
Sheet1.TextBox2.Text = strNumEntry
ElseIf Sheet1.ManSNOption.Value = True Then
strNumEntry = Sheet1.TextBox1.Text
Sheet1.TextBox2.Text = strNumEntry
Else
Sheet1.TextBox2.Text = "Error: Please choose search type"
End If
End Sub
Any ideas?
Sorry if i did not post correctly, I am new to this and hope I tagged my code correctly.