ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populate a cell with TextBox info (https://www.excelbanter.com/excel-programming/315404-populate-cell-textbox-info.html)

Sony

Populate a cell with TextBox info
 
I want to populate a specific cell with information entered on my userform in
Textbox1. It will always be the same cell so I will not need to put new
input on next line. Thank you in advance for your help.
--
Sony

JulieD

Populate a cell with TextBox info
 
Hi Sony

on the OK button of the userform the code would look something like this

Sheets("Sheet1").Range("A1").value = textbox1

Hope this helps

Cheers
JulieD

"Sony" wrote in message
...
I want to populate a specific cell with information entered on my userform
in
Textbox1. It will always be the same cell so I will not need to put new
input on next line. Thank you in advance for your help.
--
Sony




Alasdair Stirling[_3_]

Populate a cell with TextBox info
 
Assume that you have a command button (CommandButton1) on the same user form,
place the folowing code in the Declarations portion of your form:

Private Sub CommandButton1_Click()
Dim rRargetCell As Range
Set rtargetcell = ThisWorkbook.Sheets("Sheet1").Range("a1")
c.Value -TextBox1.Value
End Sub

Regards,

Alasdair Stirling

"Sony" wrote:

I want to populate a specific cell with information entered on my userform in
Textbox1. It will always be the same cell so I will not need to put new
input on next line. Thank you in advance for your help.
--
Sony


Tom Ogilvy

Populate a cell with TextBox info
 
I believe you meant it will not always be the same cell. Assume textbox1 is
on a Userform

Private Sub TextBox1_Exit(ByVal Cancel _
As MSForms.ReturnBoolean)
Dim rng as Range
With worksheets(1)
set rng = .cells(rows.count,1).End(xlup)
End with
if not isempty(rng) then set rng = rng.offset(1,0)
rng.value = Textbox1.Value
End sub

Assumes you will want to start in A1 of sheet1 and progress down the column.

--
Regards,
Tom Ogilvy


"Sony" wrote in message
...
I want to populate a specific cell with information entered on my userform

in
Textbox1. It will always be the same cell so I will not need to put new
input on next line. Thank you in advance for your help.
--
Sony




Sony

Populate a cell with TextBox info
 
Thank you Julie that was exactly what I needed

"Sony" wrote:

I want to populate a specific cell with information entered on my userform in
Textbox1. It will always be the same cell so I will not need to put new
input on next line. Thank you in advance for your help.
--
Sony


Tom Ogilvy

Populate a cell with TextBox info
 
Why not just use the controlsource (userform) property to link the textbox
to the cell.

--
Regards,
Tom Ogilvy

"Sony" wrote in message
...
Thank you Julie that was exactly what I needed

"Sony" wrote:

I want to populate a specific cell with information entered on my

userform in
Textbox1. It will always be the same cell so I will not need to put new
input on next line. Thank you in advance for your help.
--
Sony





All times are GMT +1. The time now is 02:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com