Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-06-2015, 08:36 PM
jcrennan jcrennan is offline Date Format for days 01-12 are americanized Windows 7 64bit Date Format for days 01-12 are americanized Office 2010 64bit
Novice
Date Format for days 01-12 are americanized
 
Join Date: Sep 2015
Posts: 5
jcrennan is on a distinguished road
Default Date Format for days 01-12 are americanized

Hi All

I have created a spreadsheet that uses a userform to enter data. The first field of the data is the date which I have set up as dd/mm/yyyy. Once the form is completed the USER presses the Add Record button and the VBA code places the data at the end of the current table.

I have the column set up in the spreadsheet as short date format dd/mm/yyyy.

The issue is for any day 1st to the 12th the date goes into the cell as mm/dd/yyyy however the format of the cell is still dd/mm/yyyy. eg 8th Sept 2015 goes in as 9/08/2015 and becomes 9th Aug 2015. Any date after the 12th works fine.

I have checked though my VBA code by adding msgbox's to see the value of the variable and even upto the line prior to the value being saved into the cell the Variable is correct.

I am adding the value to the cell with ".Cells(lRow, 1).Value = Me.pDate.Value" (see below)

Are there any suggestions as to how I can fix this issue.



Quote:
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
MsgBox (Me.pDate.Value)
With ws
.Cells(lRow, 1).Value = Me.pDate.Value
.Cells(lRow, 2).Value = Me.pType.Value
.Cells(lRow, 3).Value = Me.pParticipants.Value
.Cells(lRow, 4).Value = Me.pEarly.Value
.Cells(lRow, 5).Value = Me.pJunior.Value
.Cells(lRow, 6).Value = Me.pYouth.Value
.Cells(lRow, 7).Value = Me.pAdult.Value
.Cells(lRow, 8).Value = Me.pSenior.Value
.Cells(lRow, 9).Value = Me.pComments.Value
.Cells(lRow, 10).Value = Month(Me.pDate.Value)
End With
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Format for days 01-12 are americanized How to count even exact date 90 days redza Excel 1 09-17-2013 03:36 AM
Date Format for days 01-12 are americanized Date Field to add 10 Days to Current Date Erbwon Word 6 11-12-2012 06:17 PM
Set calendar alarm x days before end date el_ja Outlook 2 01-19-2012 10:09 AM
30+ days Variable Day Date Calculations via Fields ztag Word 2 01-06-2012 11:12 AM
Creating an Auto-Calc'd Date? Today+7 Days? SoCalTelephone Word 0 10-06-2010 10:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft