Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default error in userform?

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default error in userform?

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"antonov" wrote in message ...
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





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default error in userform?

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
"Ron de Bruin" wrote in message
...
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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"antonov" wrote in message
...
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







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default error in userform?

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

"antonov" skrev i melding
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform Error Steve B Excel Discussion (Misc queries) 2 February 6th 07 04:26 PM
userform error? antonov Excel Programming 2 September 9th 06 10:15 PM
userform error peter Excel Programming 0 May 1st 06 10:47 PM
error in userform damorrison Excel Discussion (Misc queries) 6 April 23rd 06 03:18 PM
userform error reuben Excel Programming 2 November 2nd 05 06:26 AM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"