error in userform?

  • Thread starter Thread starter antonov
  • Start date Start date
A

antonov

I have this userform. In some textboxes I need to input dates in a short
format (i.s. 01aug) The receiving cell in my worksheet has been correctely
formatted to display the date (01-aug-06). In fact when I input the date
without using the userform it works ok but when I do this using the userform
the display is exactely like the input (01aug). Any idea on how to fix this
problem?
This is the formula I use:

Sheets("AB").Cells(16, 12).Value = In.Text
Sheets("AB").Cells(18, 12).Value = Out.Text

When I use the program at home (in english) all works correctly, at the
office (italian) I get this problem.
Thanks for any help or suggestion
 
Why not use two dropdowns
on for the days and one for the month
Sheets("sheet1").Range("A20").Value = Format(DateSerial(Year(Date), Me.TextBox1, Me.TextBox2), "dd-mmm-yy")

This avoid input errors also and problems with dmy or mdy

Or use a calendarcontrol
http://www.rondebruin.nl/calendar.htm
 
See if this might work:
Sheets("AB").Cells(16, 12).Value = Datevalue(In.Text)
Sheets("AB").Cells(18, 12).Value = Datevalue(Out.Text)

HTH. Best wishes Harald
 
Hello Ron, I've tried to use your calendarcontrol but it give me an error
message... "Run-time error '438': Object doesn't support this property or
method...
The reason why I use the combobox is that I need my colleagues to input the
dates from this form and not directly in the sheet this to avoid errors or
differences in formats
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top