Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Read from text field

Hi I have a user form that opens when the workbook is opened. In this user
form I have text fields in which the user shall submitt info. How do I get my
macro to "read" the text submitted into the text field after a button on the
user form is pressed?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Read from text field

You do that by reading the text or caption property of the objects on the
userform. The specific code depends on your setup, but in general something
like this in the commandbutton click event, with myVar1,2 &3 being declared
public variables...

myVar1 = Userfrom1.Textbox1.Text
myVar2 = Userfrom1.Textbox2.Text
myVar3 = Userfrom1.Textbox3.Text

HTH,
Bernie
MS Excel MVP

"april27" wrote in message
...
Hi I have a user form that opens when the workbook is opened. In this user
form I have text fields in which the user shall submitt info. How do I get
my
macro to "read" the text submitted into the text field after a button on
the
user form is pressed?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Read from text field

Just access the value of the control:

msgbox Userform1.Textbox1.Value



--
Regards,
Tom Ogilvy


"april27" wrote:

Hi I have a user form that opens when the workbook is opened. In this user
form I have text fields in which the user shall submitt info. How do I get my
macro to "read" the text submitted into the text field after a button on the
user form is pressed?

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
How to read CSV lines into different Worksheets depending on a date field? Markus Obermayer Excel Discussion (Misc queries) 0 February 8th 06 11:23 PM
How to read CSV lines into different Worksheets depending on a date field? Markus Obermayer Excel Programming 0 February 8th 06 11:23 PM
how to tell excel to read numeric field as character fr a csv file Ang Kah Huat Excel Discussion (Misc queries) 3 January 11th 06 11:08 AM
Need Excel to read a text field(part#) and assign a number(commiss sstanton33 Excel Programming 1 March 18th 05 04:08 AM
HELP!! Populate text in single XL field, or bulk copy text into 1 field filmfatale[_2_] Excel Programming 0 December 9th 03 02:30 PM


All times are GMT +1. The time now is 05:37 AM.

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

About Us

"It's about Microsoft Excel"