Inserting and formating date with userform

Closed
Scencea
Posts
6
Registration date
Monday August 14, 2017
Status
Member
Last seen
August 18, 2017
- Updated on Aug 18, 2017 at 09:10 AM
 Blocked Profile - Aug 18, 2017 at 06:37 PM
Hello,

I am trying to Insert a date with a Textbox in a Userform.

It should have this format: Friday, 18.08.2017.

This entered Date is used in a Formula which I didn't define via vba.

The Formula is:

=WENN(ISTLEER(E251);"";DATUM(JAHR(E251);MONAT(E251)+D251;TAG(E251)))

How do I insert the date, that it can be used with my formula?

My code so far:

Private Sub CommandButton1_Click()


zeile = Cells(Rows.Count, 1).End(xlUp).Row + 1

Cells(zeile, 1) = ComboBox1.Text
Cells(zeile, 2) = TextBox1.Text
Cells(zeile, 3) = ComboBox2.Text
Cells(zeile, 4) = ComboBox3.Text
Cells(zeile, 5) = Format(TextBox2.Text, "dddd,d mmmm yyyy")
Cells(zeile, 8) = TextBox3.Text



Cheers

Scencea

1 reply

Try this:

Cells(zeile, 5).NumberFormat = "dddd, dd.mm.yyyy"
Cells(zeile, 5) = TextBox2.Text

This is untested, but it should do what you are expecting.


It's kind of fun to do the impossible! -Walter Elias Disney
0