Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Echo Contents of ActiveCell into a Text box. ChrisR Excel Discussion (Misc queries) 2 September 17th 09 04:00 PM
Adding text to an Activecell veeraan Excel Programming 2 October 26th 07 03:22 AM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
How do I insert Text Box in ActiveCell Borg Excel Programming 2 July 15th 06 08:23 PM
If activecell is not text John Excel Programming 1 January 27th 06 06:31 PM


All times are GMT +1. The time now is 10:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"