• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to program user form text box will type in the cell that we want

Hi ,


Just type in the cell address in the ControlSource property. For example , if in the ControlSource property , you have A1 , then any data entered in the text box will go into cell A1 on the worksheet.


Narayan
 
Store the user's input to a variable, and then set the value of a cell to that variable.

[pre]
Code:
Sub UserInput()
Dim xAnswer As String
xAnswer = InputBox("What is the answer?", "Question")
Range("A2") = xAnswer
End Sub
[/pre]
It's a similar method to get the input from a user form.
 
Does not work i will give you an example suppose i have user form Name ------


submit (coomand) when i put in the text box and submit that should submit in the suppose in row 2 column 3. How do i do that.
 
I'm afraid I don't understand what you just said. =(

Are you really using an UserForm, or do you just need an InputBox?
 
Under the code for the command button on the user form, you'll have something like this:

[pre]
Code:
Private Sub CommandButton1_Click()
Range("C2").Value = Me.TextBox1.Value 'Change this to the correct textbox name
End Sub
[/pre]
 
Back
Top