Insert a Formula in a TextBox

  • Thread starter Thread starter gatarossi
  • Start date Start date
G

gatarossi

Dear all,

I would like to insert a formula in my TextBox in the moment I
initialize my UserForm:

Private Sub UserForm_Initialize()

With cboDivision
.AddItem "HE"
.AddItem "IT"
.AddItem "IC"
.AddItem "CO"
End With

txtDate.Text = FormulaR1C1 = _
"=YEAR(TODAY())&IF(LEN(MONTH(TODAY()))=1,0&MONTH(TODAY()),MONTH
(TODAY()))&IF(LEN(DAY(TODAY()))=1,0&DAY(TODAY()),DAY(TODAY()))"

End Sub

Is it possible?

Thanks in advance!

André
 
txtDate.Text = Format(Date, "yyyymmdd")

--
__________________________________
HTH

Bob

Dear all,

I would like to insert a formula in my TextBox in the moment I
initialize my UserForm:

Private Sub UserForm_Initialize()

With cboDivision
.AddItem "HE"
.AddItem "IT"
.AddItem "IC"
.AddItem "CO"
End With

txtDate.Text = FormulaR1C1 = _
"=YEAR(TODAY())&IF(LEN(MONTH(TODAY()))=1,0&MONTH(TODAY()),MONTH
(TODAY()))&IF(LEN(DAY(TODAY()))=1,0&DAY(TODAY()),DAY(TODAY()))"

End Sub

Is it possible?

Thanks in advance!

André
 
Back
Top