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