Hi Everyone,
I'm kinda new to VBA, so I was wondering if someone can help me figure out this problem.
For some reason, rows in excel is not positioning in the righ textbox. I have provide a screen shot of the error.
As you can see. My Date textbox is showing column B.
It should be in the name textbox.
Hoping for someone to help me on this.
Below is my code.
Thank you in Advance. =)
Problem
I'm kinda new to VBA, so I was wondering if someone can help me figure out this problem.
For some reason, rows in excel is not positioning in the righ textbox. I have provide a screen shot of the error.
As you can see. My Date textbox is showing column B.
It should be in the name textbox.
Hoping for someone to help me on this.
Below is my code.
Thank you in Advance. =)
VBA Code:
Private Sub SearchBt_Click()
On Error Resume Next
Set FindData = Sheet1.Range("A:A").Find(Me.txt1.Value, , xlValues, xlWhole)
If FindData Is Nothing Then
MsgBox ("Data Not Found")
Exit Sub
Else
LastRow = FindData.Row
End If
For DataCol = 1 To 16
Me("Txt" & DataCol) = Sheet1.Cells(LastRow, DataCol).Value
Next DataCol
Problem