Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MWS MWS is offline
external usenet poster
 
Posts: 53
Default Userform input into a particular cell

Can someone tell me how I can take the value a user would enter into a
textbox of a userform and place that value into a particular worksheet cell
(ie cell A1).

For instance, I have "userform1" displayed upon the activate event of the
worksheet.

The value a user inputs into "textbox1", which is on "userform1", I want to
be valued into cell A1.

There is also "commandbutton1" on the form and I was thinking the code to
value cell A1 was needed upon the click event of the button and before the
code to hide the userform.

Any and all help would be appreciated. Thank You
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform input into a particular cell


Good evening MWS

Something like this should do the trick, attached to your buttons code
:

Range("A1").Value=Textbox1.Value

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=483225

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Userform input into a particular cell

In the CommandButton1_Click code you could put the following:

Sub CommandButton1_Click()

Worksheets("Sheet1").Range("A1").Value = UserForm1.TextBox1.Value
UserForm1.Hide

End Sub

Even better would be to have your code test the value of the textbox to make
sure it is appropriate - for example, if it must be a date:

Sub CommandButton1_Click()
Dim DateOK as Boolean

DateOK = IsDate(UserForm1.TextBox1.Value)
If Not (DateOK)
MsgBox "Input value must be a date"
Else
Worksheets("Sheet1").Range("A1").Value = UserForm1.TextBox1.Value
UserForm1.Hide
End If

End Sub

--
- K Dales


"MWS" wrote:

Can someone tell me how I can take the value a user would enter into a
textbox of a userform and place that value into a particular worksheet cell
(ie cell A1).

For instance, I have "userform1" displayed upon the activate event of the
worksheet.

The value a user inputs into "textbox1", which is on "userform1", I want to
be valued into cell A1.

There is also "commandbutton1" on the form and I was thinking the code to
value cell A1 was needed upon the click event of the button and before the
code to hide the userform.

Any and all help would be appreciated. Thank You

  #4   Report Post  
Posted to microsoft.public.excel.programming
MWS MWS is offline
external usenet poster
 
Posts: 53
Default Userform input into a particular cell

I will try this - Thank You for Your Assistance, I appreciate your help and
quick response. Take Care

"K Dales" wrote:

In the CommandButton1_Click code you could put the following:

Sub CommandButton1_Click()

Worksheets("Sheet1").Range("A1").Value = UserForm1.TextBox1.Value
UserForm1.Hide

End Sub

Even better would be to have your code test the value of the textbox to make
sure it is appropriate - for example, if it must be a date:

Sub CommandButton1_Click()
Dim DateOK as Boolean

DateOK = IsDate(UserForm1.TextBox1.Value)
If Not (DateOK)
MsgBox "Input value must be a date"
Else
Worksheets("Sheet1").Range("A1").Value = UserForm1.TextBox1.Value
UserForm1.Hide
End If

End Sub

--
- K Dales


"MWS" wrote:

Can someone tell me how I can take the value a user would enter into a
textbox of a userform and place that value into a particular worksheet cell
(ie cell A1).

For instance, I have "userform1" displayed upon the activate event of the
worksheet.

The value a user inputs into "textbox1", which is on "userform1", I want to
be valued into cell A1.

There is also "commandbutton1" on the form and I was thinking the code to
value cell A1 was needed upon the click event of the button and before the
code to hide the userform.

Any and all help would be appreciated. Thank You

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, with no input pgarcia Excel Discussion (Misc queries) 0 September 14th 07 05:02 PM
Formatiing a input Box in a Userform Jeff Excel Discussion (Misc queries) 0 April 13th 06 08:57 PM
Userform Input Into Excel Kris Taylor Excel Programming 5 January 19th 05 06:02 PM
Userform-allow numerical input? waveracerr[_20_] Excel Programming 2 September 14th 04 08:11 PM
How to display contents of a cell in UserForm and take input ssexcel[_3_] Excel Programming 2 October 28th 03 12:37 AM


All times are GMT +1. The time now is 01:57 PM.

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"