Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Desperation is Setting in - Date Formats! :-(

I have a series of UserForms capturing and writing data to an worksheet,
trouble is no matter how I format anything cannot get the format of a date
entered in the UserForm to match the worksheet formats. ie When I enter
05/02/06 (5th Feb 06)on the UserForm it is transposed to 02/05/06 (2nd May
06) on the worksheet!

Am I going nuts or is there a way to get around this - it's seriously
knocking my plug in now!

--
Zani
(if I have posted here, I really am stuck!)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Desperation is Setting in - Date Formats! :-(

Hi Zani

You have to set right format on cells

Regads Yngve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Desperation is Setting in - Date Formats! :-(

Hi, no that's not it. the cell formats are OK, it is something weird to do
with VB being in US format, and I am working in UK format - am so confused!!!!
--
Zani
(if I have posted here, I really am stuck!)



"Yngve" wrote:

Hi Zani

You have to set right format on cells

Regads Yngve


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Desperation is Setting in - Date Formats! :-(

Hi Zani,

Try:

Range("A1").Value = CDate(Me.TextBox1.Value)

---
Regards,
Norman



"Zani" wrote in message
...
I have a series of UserForms capturing and writing data to an worksheet,
trouble is no matter how I format anything cannot get the format of a date
entered in the UserForm to match the worksheet formats. ie When I enter
05/02/06 (5th Feb 06)on the UserForm it is transposed to 02/05/06 (2nd May
06) on the worksheet!

Am I going nuts or is there a way to get around this - it's seriously
knocking my plug in now!

--
Zani
(if I have posted here, I really am stuck!)



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Desperation is Setting in - Date Formats! :-(

Zani,

For a previous posting (thanks to Tom Ogilvy):

Private Sub textbox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Range("a1") = CDate(TextBox1.Text)
Range("a1").NumberFormat = "dd/mm/yy"
End Sub

I am UK-Based and share your frustration.

HTH

End Sub"Zani" wrote:

Hi, no that's not it. the cell formats are OK, it is something weird to do
with VB being in US format, and I am working in UK format - am so confused!!!!
--
Zani
(if I have posted here, I really am stuck!)



"Yngve" wrote:

Hi Zani

You have to set right format on cells

Regads Yngve




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Desperation is Setting in - Date Formats! :-(

Hi Zani

TextBox1.Value = Format(TextBox1.Value, "dd-mmm-yyyy")

Regards Yngve

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Desperation is Setting in - Date Formats! :-(

Thanks chaps - your posts came just in time to stop me throwing myself off
the roof - I thought I was going nuts! One to remember for the future me
thinks.

Thanks again - only hope I will be knowledgeable enough one day to help
people in return.
--
Zani
(if I have posted here, I really am stuck!)



"Norman Jones" wrote:

Hi Zani,

Try:

Range("A1").Value = CDate(Me.TextBox1.Value)

---
Regards,
Norman



"Zani" wrote in message
...
I have a series of UserForms capturing and writing data to an worksheet,
trouble is no matter how I format anything cannot get the format of a date
entered in the UserForm to match the worksheet formats. ie When I enter
05/02/06 (5th Feb 06)on the UserForm it is transposed to 02/05/06 (2nd May
06) on the worksheet!

Am I going nuts or is there a way to get around this - it's seriously
knocking my plug in now!

--
Zani
(if I have posted here, I really am stuck!)




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
Setting default formats Dave Excel Discussion (Misc queries) 4 January 27th 08 05:05 PM
GETPIVOTDATA....Excel 2000....Desperation! Kev[_2_] Excel Worksheet Functions 1 June 12th 07 10:42 AM
Setting up templates with formats michelle Excel Discussion (Misc queries) 0 September 25th 06 02:50 PM
VBA Setting .Value to a date does not respect local system setting Frank_Hamersley Excel Programming 13 July 18th 04 02:51 PM
Index / Match - desperation Kuba Excel Programming 0 December 23rd 03 03:36 PM


All times are GMT +1. The time now is 11:11 AM.

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

About Us

"It's about Microsoft Excel"