ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text Box Value From ActiveCell (https://www.excelbanter.com/excel-programming/419774-text-box-value-activecell.html)

goss

Text Box Value From ActiveCell
 
Hi all,

When my form loads I would like the text box to display the contents
of the activecell
I thought the code below would accomplish my goal
But the textbox is empt when the forrm is displayed
The name of the form is correct and the name of the text box is
correct
No errors are cast

Thanks!
goss

Code:
Private Sub frmRevenueIntegration_Initialize()
txtCurrentDate = ActiveCell.Value
End Sub

Mike

Text Box Value From ActiveCell
 

Private Sub UserForm_Initialize()
txtCurrentDate = ActiveCell.Value
End Sub
"goss" wrote:

Hi all,

When my form loads I would like the text box to display the contents
of the activecell
I thought the code below would accomplish my goal
But the textbox is empt when the forrm is displayed
The name of the form is correct and the name of the text box is
correct
No errors are cast

Thanks!
goss

Code:
Private Sub frmRevenueIntegration_Initialize()
txtCurrentDate = ActiveCell.Value
End Sub


JLGWhiz

Text Box Value From ActiveCell
 
Adding to Mike's input, the initialize event can only be executed in the
form's code module. Therefor, the predefined macro name of
UserForm_Initialize must be used to perform the actions under the initialize
event. This applies to all of the predefined event codes listed under the
declarations of the user form. You can add a name in the properties window,
then click the declarations drop down and click on any event and it
automatically inserts Private Sub UserForm_<event into the code window.

"goss" wrote:

Hi all,

When my form loads I would like the text box to display the contents
of the activecell
I thought the code below would accomplish my goal
But the textbox is empt when the forrm is displayed
The name of the form is correct and the name of the text box is
correct
No errors are cast

Thanks!
goss

Code:
Private Sub frmRevenueIntegration_Initialize()
txtCurrentDate = ActiveCell.Value
End Sub


goss

Text Box Value From ActiveCell
 
On Nov 10, 8:42*am, JLGWhiz wrote:
Adding to Mike's input, the initialize event can only be executed in the
form's code module. *Therefor, the predefined macro name of
UserForm_Initialize must be used to perform the actions under the initialize
event. *This applies to all of the predefined event codes listed under the
declarations of the user form. *You can add a name in the properties window,
then click the declarations drop down and click on any event and it
automatically inserts Private Sub UserForm_<event into the code window.



"goss" wrote:
Hi all,


When my form loads I would like the text box to display the contents
of the activecell
I thought the code below would accomplish my goal
But the textbox is empt when the forrm is displayed
The name of the form is correct and the name of the text box is
correct
No errors are cast


Thanks!
goss


Code:
Private Sub frmRevenueIntegration_Initialize()
* * txtCurrentDate = ActiveCell.Value
End Sub- Hide quoted text -


- Show quoted text -


Thanks guys!
It is returning the incorrect value
So instead of activecell I need to tell the userfrom to initialize
with textbox displaying the contents of

Sheet: Data
Cell (r,3)
Where r is first non-numeric value found in col 3

Can I pass these argument to the userform_intialize event?

Thanks!
goss

goss

Text Box Value From ActiveCell
 
On Nov 11, 4:13*am, goss wrote:
On Nov 10, 8:42*am, JLGWhiz wrote:





Adding to Mike's input, the initialize event can only be executed in the
form's code module. *Therefor, the predefined macro name of
UserForm_Initialize must be used to perform the actions under the initialize
event. *This applies to all of the predefined event codes listed under the
declarations of the user form. *You can add a name in the properties window,
then click the declarations drop down and click on any event and it
automatically inserts Private Sub UserForm_<event into the code window..


"goss" wrote:
Hi all,


When my form loads I would like the text box to display the contents
of the activecell
I thought the code below would accomplish my goal
But the textbox is empt when the forrm is displayed
The name of the form is correct and the name of the text box is
correct
No errors are cast


Thanks!
goss


Code:
Private Sub frmRevenueIntegration_Initialize()
* * txtCurrentDate = ActiveCell.Value
End Sub- Hide quoted text -


- Show quoted text -


Thanks guys!
It is returning the incorrect value
So instead of activecell I need to tell the userfrom to initialize
with textbox displaying the contents of

Sheet: Data
Cell (r,3)
Where r is first non-numeric value found in col 3

Can I pass these argument to the userform_intialize event?

Thanks!
goss- Hide quoted text -

- Show quoted text -


Bump.
Hi all.
Any idea how I can get the value of the cell I reference above to the
text box on the userform when it initializes?

Thanks!
goss


All times are GMT +1. The time now is 06:24 AM.

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