UserForm TextBox

L

LaDdIe

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.
 
R

Rick Rothstein \(MVP - VB\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top