Textbox value to cell

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
207
I need some Help to get Value from 16 differens Textbox to set value in Specific cell's
on my Userform12

textbox 1 to cell P7
textbox 2 to cell P8

and so on to Textbox 16

i have search around google but not find the answer i want
 
Last edited:

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I need some Help to get Value from 16 differens Textbox to set value in Specific cell's
on my Userform12

textbox 1 to cell P7
textbox 2 to cell P8

and so on to Textbox 16

i have search around google but not find the answer i want

As far as i know you can take the text from a cell and put it in a text box, but not the other way around. Why not link all your textboxes to cells somewhere in the workbook, and then reference those cells when you need the value in the textbox

You can link a text box to a cell by inserting a text box(or edit text) and in the formula bar type = and then the cell reference you want it to be equal to
 
Last edited:
Upvote 0
Assuming you want to enter Userform Textbox values into active sheet try this:

Code:
Private Sub CommandButton1_Click()
'Modified  6/11/2019  4:02:20 PM  EDT
Dim i As Long
For i = 1 To 16
    Cells(i + 6, "P").Value = Me.Controls("TextBox" & i).Value
Next
End Sub
 
Last edited:
Upvote 0
I figure it out

by this code
Code:
Private Sub TextBox1_Change()    Range("P7").value = TextBox1.value ' specify the destination sheet and cell hereEnd Sub

and so on to my textbox 16
 
Upvote 0
And what was wrong with my code?
Put it in a Command Button and it will do all you want.

You gave no comment about my Help.
 
Upvote 0
Your script will enter the value immediately as you type
 
Last edited:
Upvote 0
When i try your code my textbox on my userform
aint put Data in the specific cell’s for each texbox
because you code put them into 1-16

Yes i got 16 textbox but with free space between them
like this first textbox cell P7 next P8 - P11 P12 next
P15-P16 and so on to textbox 16
 
Upvote 0
My script puts Textbox values into Column P Starting in Row(7)

And enters values down to Row 27

If there is a Problem it's because your TextBoxs are not TextBox1 to TextBox 16

I test all my scripts and can assure you it does not start in Row(1)
 
Upvote 0
My textbox is starting from 1 to 16
but i need Space between each value sæt in Row P for esch textbox
like
textbox 1 = P7
textbox 2 = P8

textbox 3 = P11
textbox 4 = P12

with space of 4 cell
and so on to textbox 16
 
Upvote 0
Well you said:
Row P

There is no Row P

There is a column P

And you said:
with space of 4 cell

Your example shows:


textbox 1 = P7
textbox 2 = P8

There are no 4 spaces here.
<strike>
</strike>
 
Upvote 0

Forum statistics

Threads
1,224,876
Messages
6,181,519
Members
453,050
Latest member
Obil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top