View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
B Wassen B Wassen is offline
external usenet poster
 
Posts: 2
Default Forcing the cursor

Hello,

In a form I like to force the cursor to start in textbox1 because when I
open the form now it starts with the cursor in textbox2.

Private Sub CommandButton3_Click()

On Error Resume Next
FormWijzigen TextBox1.SetFocus
With Sheets("Data").Range("B:B").Find(TextBox1.Value,
LookIn:=xlValues)

TextBox2.Value = .Offset(0, -1).Value
TextBox3.Value = .Offset(0, 1).Value
TextBox4.Value = .Offset(0, 0).Value
TextBox5.Value = .Offset(0, 2).Value
TextBox6.Value = .Offset(0, 3).Value
TextBox7.Value = .Offset(0, 4).Value
TextBox8.Value = .Offset(0, 5).Value
TextBox9.Value = .Offset(0, 6).Value
TextBox10.Value = .Offset(0, 7).Value
End With
End Sub

Ben