ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Populating a UserForm'sTextBox with a value (https://www.excelbanter.com/excel-discussion-misc-queries/36725-populating-userformstextbox-value.html)

Rob

Populating a UserForm'sTextBox with a value
 
Hi,

I would like to know how to get a UserForm's TextBox to show the value of a
cell when the UserForm is opened.
I named the TextBox GiftTextBox, and I was hoping something like
GiftTextBox.Value = ActiveCell.Offset(0, 6).Value would do it but I can't
get that to work. Is there a simple way for the ActiveCell.Offset(0,
6).Value to be shown somehow on the UserForm? I don't care whether it's in a
TextBox or some other box, as long as I can get the value to appear on the
UserForm.

Rob



Jim Cone


Rob,

Something like...
UserForm1.GiftTextBox.Value = ActiveCell.Offset(0, 6).Value

Jim Cone
San Francisco, USA


"Rob" wrote in message
u...
Hi,
I would like to know how to get a UserForm's TextBox to show the value of a
cell when the UserForm is opened.
I named the TextBox GiftTextBox, and I was hoping something like
GiftTextBox.Value = ActiveCell.Offset(0, 6).Value would do it but I can't
get that to work. Is there a simple way for the ActiveCell.Offset(0,
6).Value to be shown somehow on the UserForm? I don't care whether it's in a
TextBox or some other box, as long as I can get the value to appear on the
UserForm.
Rob



Henry

Rob,

Try
GiftTextBox.Text = ActiveCell.Offset(0, 6).Value

Henry


"Rob" wrote in message
u...
Hi,

I would like to know how to get a UserForm's TextBox to show the value of
a cell when the UserForm is opened.
I named the TextBox GiftTextBox, and I was hoping something like
GiftTextBox.Value = ActiveCell.Offset(0, 6).Value would do it but I can't
get that to work. Is there a simple way for the ActiveCell.Offset(0,
6).Value to be shown somehow on the UserForm? I don't care whether it's in
a TextBox or some other box, as long as I can get the value to appear on
the UserForm.

Rob




Rob

Hi Henry,

Thanks for that, but in my application I needed Jim's suggestion by adding
the UserForm's name to the beginning of the line.

Rob

"Henry" wrote in message
...
Rob,

Try
GiftTextBox.Text = ActiveCell.Offset(0, 6).Value

Henry


"Rob" wrote in message
u...
Hi,

I would like to know how to get a UserForm's TextBox to show the value of
a cell when the UserForm is opened.
I named the TextBox GiftTextBox, and I was hoping something like
GiftTextBox.Value = ActiveCell.Offset(0, 6).Value would do it but I can't
get that to work. Is there a simple way for the ActiveCell.Offset(0,
6).Value to be shown somehow on the UserForm? I don't care whether it's
in a TextBox or some other box, as long as I can get the value to appear
on the UserForm.

Rob






Rob

Hi Jim,

I was so close....but thanks! It did the trick. You can try so many things
and miss the obvious.

Rob

"Jim Cone" wrote in message
...

Rob,

Something like...
UserForm1.GiftTextBox.Value = ActiveCell.Offset(0, 6).Value

Jim Cone
San Francisco, USA


"Rob" wrote in message
u...
Hi,
I would like to know how to get a UserForm's TextBox to show the value of
a
cell when the UserForm is opened.
I named the TextBox GiftTextBox, and I was hoping something like
GiftTextBox.Value = ActiveCell.Offset(0, 6).Value would do it but I can't
get that to work. Is there a simple way for the ActiveCell.Offset(0,
6).Value to be shown somehow on the UserForm? I don't care whether it's in
a
TextBox or some other box, as long as I can get the value to appear on the
UserForm.
Rob






All times are GMT +1. The time now is 08:37 PM.

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