Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default UserForm TextBox

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default UserForm TextBox

Thanks Rick, Just the job, The rest I can tweak

Regards
LaDdIe

"Rick Rothstein (MVP - VB)" wrote:

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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform TextBox LaDdIe Excel Programming 4 August 11th 07 08:32 AM
Userform textbox help [email protected] Excel Programming 1 September 17th 06 08:27 AM
Userform textbox help [email protected] Excel Programming 0 September 16th 06 10:57 PM
Textbox in userform Harald Staff Excel Programming 0 September 8th 04 11:51 AM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 08:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"