![]() |
#1
|
|||
|
|||
![]()
Hi There,
I am sorry if i am repeating another post but i could not see one. I have two date issues in a word VBA userform project. I am using calendar control 12.0 and it retuns a date in form 9/2/13 i need it to be Sunday 9th Febuary 2013 please help. secondly i have a textbox that populates info from a spreadsheet that works well the another text box that calcultes with the ADDDate function to add one year for example Texbox 1 = 30/6/2013 - textbox 2 = 30/06/2014 but the textbox2 return in a us date eg. 06/30/2014 i need it to be 30/06/2014 but the format i am using example below retrns a very strange date which is 11/02/13 this is the format code Private Sub nfyee_Change() Me.nfyee.Value = Format(Date, "dd/mm/yyyy") End Sub Thanks heaps. Gordon |
#2
|
||||
|
||||
![]()
Hi Gordon,
For the first problem, try something based on: Code:
Private Sub Calendar1_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox1.Text = Format(Calendar1.Value, "DDDD ") & Ordinal(Calendar1.Day) & Format(Calendar1.Value, " MMMM YYYY") End Sub Function Ordinal(Val As Integer) As String Dim strOrd As String If (Val Mod 100) < 11 Or (Val Mod 100) > 13 Then strOrd = Choose(Val Mod 10, "st", "nd", "rd") & "" Ordinal = Val & IIf(strOrd = "", "th", strOrd) End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
thank you so much that first one work a treat.
Ok this is where i am a dummy. I have not validated that field but that one is fine it is when i want it to calculate + 1 year it goes all funny. |
#4
|
||||
|
||||
![]()
What does your TextBox that imports the date actually display? What is the code that populates it?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Make table cell active add date count date | MelHerndon | Word VBA | 3 | 01-21-2013 04:23 PM |
![]() |
ketanco | Project | 1 | 02-08-2012 02:20 PM |
Issues with synchronization log causing send/receive issues | WinSock64 | Outlook | 0 | 01-11-2011 11:29 AM |
new appointment date always reverts back to today's date | msills | Outlook | 0 | 08-24-2007 08:57 AM |
![]() |
promark | Outlook | 1 | 12-23-2005 07:21 AM |