UserForm TextBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I've got a userform with a text box on it, and some comand buttons that move
active cell left or right, How do I program the text box to display the value
the active cell offset by 2 rows, the value happens to be a date.

Thanks for any help.

Regards
Laddie.
 
Assuming your controls are named with the default names VBA assigns, use
this...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With UserForm1
If .Visible = True Then
.TextBox1.Value = ActiveCell.Offset(2, 0).Value
End If
End With
End Sub

in the worksheet code window (**not** the user form code window).

Rick
 
Back
Top