Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Userform Textbox to Worksheet Textbox

I have a userform textbox that I want to transfer the user-entered data from
into a VBA textbox on a worksheet (Excel 2003).
Psuedo Code:
Userform loads
User enters data into userform's textbox
User clicks "Ok" on the userform
Userform opens workbook
Userform transfers data from its textbox to the textbox on the worksheet
How do I reference the textbox on the worksheet (its name is "CRDetails")?
TIA,
Trent Argante
[DC.J(166)]
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 419
Default Userform Textbox to Worksheet Textbox

Trent,

Since you say:

Userform loads

...
Userform opens workbook


I think it is safe to assume that the user form is in a different workbook
than the one you are opening. Will the workbook that opens be the same one
every time?

Here is a little code that I just whipped up that hides the form, then
transfers text typed into the form's text box to the sheet's text box when
the button is clicked. My text box on the work sheet and the one on the
form are both named "TextBox1". Change your code accordingly.


Private Sub CommandButton1_Click()
Me.Hide
Worksheets("Sheet1").TextBox1.Text = Me.TextBox1.Text
End Sub


You will probably have to qualify sheet's text box part of the statement
with the workbook as well. So...

Worksheets("Sheet1").TextBox1.Text = Me.TextBox1.Text

....will become something like this...

Workbooks("PERSONAL.XLS").Worksheets("Sheet1").Tex tBox1.Text =
Me.TextBox1.Text

Change the workbook name, worksheet name, and text box names accordingly.

HTH,

Conan Kelly






"targante" wrote in message
...
I have a userform textbox that I want to transfer the user-entered data
from
into a VBA textbox on a worksheet (Excel 2003).
Psuedo Code:
Userform loads
User enters data into userform's textbox
User clicks "Ok" on the userform
Userform opens workbook
Userform transfers data from its textbox to the textbox on the worksheet
How do I reference the textbox on the worksheet (its name is "CRDetails")?
TIA,
Trent Argante
[DC.J(166)]



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
fill userform textbox from userform listbox clik event GregJG[_21_] Excel Programming 3 December 7th 08 04:47 PM
Textbox from 1st worksheet to textbox to other multiple sheets LRay67 Excel Programming 2 March 18th 08 02:20 PM
Userform Textbox multiline Vs format in worksheet Jim May Excel Programming 4 October 16th 05 10:15 PM
Add worksheet based on textbox/userform Mark \(InWales\)[_13_] Excel Programming 2 November 17th 04 09:57 PM
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 04:11 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"