UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Input Box in UK Date format    
 
   
bdj
post Nov 6 2002, 06:08 PM
Post #1

UtterAccess Enthusiast
Posts: 74
From: Scotland



Can anyone please explain how I get the Input Box to take a UK formatted date. The following coding works perfectly except that it will insist on the input box in US format. Cell E2 is correctly formatted as UK

Dim Startdate as Date

Worksheets(1).Range("E2").Select
Selection.NumberFormat = "dd/mm/yyyy"
ActiveCell.FormulaR1C1 = InputBox("Input the first day of the new month ie 01/09/2002")
Startdate = ActiveCell.FormulaR1C1

An urgent reply would be appreciated as it’s holding me up.

Thanks
Go to the top of the page
 
+
Scomac
post Nov 7 2002, 04:17 AM
Post #2

UtterAccess Guru
Posts: 969
From: Scotland



Have u made sure that your region settings on your clock setting in control panel is set to UK standard date?
Go to the top of the page
 
+
bdj
post Nov 7 2002, 02:36 PM
Post #3

UtterAccess Enthusiast
Posts: 74
From: Scotland



Yes the control settings are set for UK and UK date format. That was the only thing I could think of myself.
Go to the top of the page
 
+
BradKennedy
post Nov 8 2002, 06:29 AM
Post #4

Author of post 100,000!
Posts: 258
From: Melbourne, Australia



bdj

You could always set the cell = to a variable that you format with code before entering into the cell.

Example
x="15-05-02"
Range("A1")= format(x, "dd-mm-yy")

HTH

Brad
Go to the top of the page
 
+
bdj
post Nov 8 2002, 11:33 AM
Post #5

UtterAccess Enthusiast
Posts: 74
From: Scotland



unfortunately this would defeat the fully automated setting up of the spreadsheet.

Everything is based on the initial date being input. That is why I was using an input box in a macro rather than an input to a particular cell.

Thanks for all your help though

Brian
Go to the top of the page
 
+
Scomac
post Nov 8 2002, 11:46 AM
Post #6

UtterAccess Guru
Posts: 969
From: Scotland



mm i dunno but why not replace the input box with a userform?
Go to the top of the page
 
+
BradKennedy
post Nov 11 2002, 03:25 PM
Post #7

Author of post 100,000!
Posts: 258
From: Melbourne, Australia



bdj,

What I showed you was code for an input box.
It takes the value and formats it, then outputs it.

If you need further explanation let me know.

Brad.
Go to the top of the page
 
+
bdj
post Nov 12 2002, 05:53 PM
Post #8

UtterAccess Enthusiast
Posts: 74
From: Scotland



Believe it or not I resolved it by just reformatting the input to:-

Selection.NumberFormat = "dd/mmm/yyyy"

In this format there is no possibility of it using US format.

Thanks for all your input, I'm very grateful

Brian
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 05:28 AM