Many thanks that works but I need it to select the data on that row from
sheet2 to several textboxes on a userform.
I have the following code so far. The data is found
on sheet2
Private Sub CommandButton4_Click()
Dim FoundCell As Range
ActiveCell.Offset(-1, 0).Select
If FoundCell Is Nothing Then
'this shouldn't happen!
Beep
Else
Me.TextBox1.Value = FoundCell.Offset(0, 1).Value
Me.ComboBox1.Value = FoundCell.Offset(0, 1).Value
Me.TextBox2.Value = FoundCell.Offset(0, 2).Value
If IsDate(FoundCell.Offset(0, 0).Value) Then
Me.TextBox1.Value = Format(FoundCell.Offset(0, 0).Value, "dd-mmm-yy")
Else
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
End If
End If
End Sub
Your code is modified. Could check it over.
Many thanks
--
Bob
"DILipandey" wrote:
Hi Bob,
Try following:-
To select next up row:-
ActiveCell.Offset(-1, 0).EntireRow.Select
To Select next down rol:-
ActiveCell.Offset(1, 0).EntireRow.Select
Thanks.
--
Click on Yes, if it is useful.
Thanks & Best Regards,
Dilip Kumar Pandey
MBA, BCA, B.Com(Hons.)
New Delhi, India
"Bob" wrote:
--
Bob