Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform that when i initialize it i want to show some numbers in a
textbox. However nothing is shown in the textbox. what am i doing wrong? pls help me! Private Sub UserForm1_Initialize() Dim dblErrorMarginal As Double set dblErrorMarginal = 0.01 UserForm1.TextBox1.text = dblErrorMarginal End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See response in .programming
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Arne Hegefors" wrote in message ... I have a userform that when i initialize it i want to show some numbers in a textbox. However nothing is shown in the textbox. what am i doing wrong? pls help me! Private Sub UserForm1_Initialize() Dim dblErrorMarginal As Double set dblErrorMarginal = 0.01 UserForm1.TextBox1.text = dblErrorMarginal End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
.... to your previous question that is, there is no need to re-post, we heard
first time. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Arne Hegefors" wrote in message ... I have a userform that when i initialize it i want to show some numbers in a textbox. However nothing is shown in the textbox. what am i doing wrong? pls help me! Private Sub UserForm1_Initialize() Dim dblErrorMarginal As Double set dblErrorMarginal = 0.01 UserForm1.TextBox1.text = dblErrorMarginal End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sorry that was not my intentention. thank you for your reply on the last
question. However this question is not the same as the one you answered as you might see from you response. Now I am having trouble showing anything in the textbox, thus not dependent on the info in the cell as my last question suggested. Thanks. "Bob Phillips" skrev: .... to your previous question that is, there is no need to re-post, we heard first time. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Arne Hegefors" wrote in message ... I have a userform that when i initialize it i want to show some numbers in a textbox. However nothing is shown in the textbox. what am i doing wrong? pls help me! Private Sub UserForm1_Initialize() Dim dblErrorMarginal As Double set dblErrorMarginal = 0.01 UserForm1.TextBox1.text = dblErrorMarginal End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Arne
put you code in UserForm_Activate() At a long shot, I'd say, the userform isn't there before initialize has finished. -- Greetings from Bavaria, Germany Helmut Weber Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi. thanks. yes I tried that but without any success. I have tried walking
through the userform1_initialize code by using F8 but the after the userform is show and the cursor in the textbox is blinking I cannot keep walking through the code so I guess it stops there if I do not press any buttons etc. I dont understand this. usually I use initialize and have lots of code in the initialize sub but now it just does not work. pls help me! I just want to be able to show so text in the textbox! thanks very much! "Helmut Weber" skrev: Hi Arne put you code in UserForm_Activate() At a long shot, I'd say, the userform isn't there before initialize has finished. -- Greetings from Bavaria, Germany Helmut Weber Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Arne,
you've tried with the code in activate? Otherwise, delay execution in initialize. This one works as well for me. Private Sub UserForm_Initialize() Dim x As Long x = Me.Controls.Count Me.TextBox1.text = "ddd" End Sub I'm not an excel-expert. But I've some experience with office and auto-macros of all kind. If autoopen (Word) loads a doc or a template, is seems impossible to do some things with it, like arranging commandbars, as they aren't accessible before the automacro has completed. To me, initialize is some kind af auto-macro. Good luck. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Arne,
I tried your code and got the message "Object Required" for the "Set" statement. Once I removed the word "Set", the code worked fine: Private Sub UserForm_Initialize() Dim dblErrorMarginal As Double dblErrorMarginal = 0.01 UserForm1.TextBox1.Text = dblErrorMarginal End Sub Jim Arne Hegefors wrote: I have a userform that when i initialize it i want to show some numbers in a textbox. However nothing is shown in the textbox. what am i doing wrong? pls help me! Private Sub UserForm1_Initialize() Dim dblErrorMarginal As Double set dblErrorMarginal = 0.01 UserForm1.TextBox1.text = dblErrorMarginal End Sub |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you write the Initialize routine?
It would appear you used Userform1 instead of just userform. try this instead. Private Sub UserForm_Initialize() Set rngErrorMarginCell = Range("d5") dblErrorMarginal = rngErrorMarginCell.Value TextBox1.Text = dblErrorMarginal End Sub Cheers Andy Arne Hegefors wrote: I have a userform that when i initialize it i want to show some numbers in a textbox. However nothing is shown in the textbox. what am i doing wrong? pls help me! Private Sub UserForm1_Initialize() Dim dblErrorMarginal As Double set dblErrorMarginal = 0.01 UserForm1.TextBox1.text = dblErrorMarginal End Sub -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
userform initialize | Excel Programming | |||
Userform initialize combobox using Chr() function. | Excel Programming | |||
Userform Initialize & combo box values | Excel Discussion (Misc queries) | |||
initialize userform, using a sub | Excel Programming | |||
Qn: Define a variable in Initialize for Userform | Excel Programming |