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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Your original question was very simple:
You said:

textbox 1 to cell P7
textbox 2 to cell P8

and so on to Textbox 16

And that is exactly what my script does.

No where in your original post did you mention spaces.

A screen dump would not help me.
 
Upvote 0
If I am not mistaken, this (untested) modification to the macro My Aswer Is This posted should do what you want...
Code:
Sub CommandButton1_Click()
  Dim X As Long, R As Long
  R = 3
  For X = 1 To 16
    R = R + 4
    Cells(R, "P").Value = Me.Controls("TextBox" & X).Value
    Cells(R + 1, "P").Value = Me.Controls("TextBox" & X).Value
  Next
End Sub
 
Upvote 0
Sorry for not descripe what i want proberly first Time...

Yes My textbox's have this function to Put names into a Cupsystem
and in that system i got Cell P7 for first Player and P8 for second player
the third Player came in Cell P11 and Forth Player in P12
the Fift player in cell P15 and Sixt Player in P16
and so on to Player sixteen wich will end in cell P36


A screendumb would might havend given a idea of how it should Look
 
Upvote 0
I really do not see why my script needs to be modified. The script does exactly what the user asked for in post 1.
If I am not mistaken, this (untested) modification to the macro My Aswer Is This posted should do what you want...
Code:
Sub CommandButton1_Click()
  Dim X As Long, R As Long
  R = 3
  For X = 1 To 16
    R = R + 4
    Cells(R, "P").Value = Me.Controls("TextBox" & X).Value
    Cells(R + 1, "P").Value = Me.Controls("TextBox" & X).Value
  Next
End Sub
 
Upvote 0
Thanks for the Code But it aint work as it ment to do...

If i put name in Textbox1 and 2 and click on Button then it make it Twice
and Player 1 in textbox 1 and Player 2 in Textbox 2

then result is like this

P7 =player 1
P8 =player 1

P11 = Player 2
P12 = Player 2
 
Upvote 0
In post 4 you said:
I figure it out

So I suggest you just continue using your code which you said worked.

My script assumed you wanted all textbox values entered at the same time.
 
Upvote 0
Hm HM yes i have figure it out by Entering a Code for Each Text box's

but like your's Idea by Written all names in all Text box and then click on Button to fill My cell's

But thanks Anyway for trying to help Me.....
 
Upvote 0

Forum statistics

Threads
1,223,931
Messages
6,175,465
Members
452,646
Latest member
tudou

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