View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default UserForm TextBox

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


"LaDdIe" wrote in message
...
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.