Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default inputbox uk date

Hi
I have a macro which request a date which is then used in an advanced filter
My problem is the date seems to be american format mm/dd/yy but i need uk
the cell g2 is formatted to dd/mm/yy but comes out as mm/dd/yy after
inputbox used
MYDATE = InputBox("ENTER DATE DD/MM/YY")
Range("G1") = "<="
Range("G2") = MYDATE
how do I format inputbox?
thanks Tina
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default inputbox uk date

I'm afraid you have to change your Windows/Regional Settings/Language from
English US to English UK.
Regards,
Stefi


€˛tina€¯ ezt Ć*rta:

Hi
I have a macro which request a date which is then used in an advanced filter
My problem is the date seems to be american format mm/dd/yy but i need uk
the cell g2 is formatted to dd/mm/yy but comes out as mm/dd/yy after
inputbox used
MYDATE = InputBox("ENTER DATE DD/MM/YY")
Range("G1") = "<="
Range("G2") = MYDATE
how do I format inputbox?
thanks Tina

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default inputbox uk date

Make sure that you declare MyDate as a Date variable.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"tina" wrote in message
...
Hi
I have a macro which request a date which is then used in an advanced

filter
My problem is the date seems to be american format mm/dd/yy but i need uk
the cell g2 is formatted to dd/mm/yy but comes out as mm/dd/yy after
inputbox used
MYDATE = InputBox("ENTER DATE DD/MM/YY")
Range("G1") = "<="
Range("G2") = MYDATE
how do I format inputbox?
thanks Tina



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default inputbox uk date

Thanks Bob
I had tried lots of formatting but forgot about declaring variable I do not
decale much as macros seem to work without but obviously more important than
I thought must stop being lazy and use good practises
thanks again
Tina

"Bob Phillips" wrote:

Make sure that you declare MyDate as a Date variable.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"tina" wrote in message
...
Hi
I have a macro which request a date which is then used in an advanced

filter
My problem is the date seems to be american format mm/dd/yy but i need uk
the cell g2 is formatted to dd/mm/yy but comes out as mm/dd/yy after
inputbox used
MYDATE = InputBox("ENTER DATE DD/MM/YY")
Range("G1") = "<="
Range("G2") = MYDATE
how do I format inputbox?
thanks Tina




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default inputbox uk date

Tina,

It is always a good practice to declare variables, and even better to add
Option Explicit at the start of a module, which will catch typos. Even
better, set it as a default in your options,

in the VBIDE goto ToolsOptions;
on the Editor tab click the Require Variable Declaration checkbox;
it will then automatically be added to all modules.


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"tina" wrote in message
...
Thanks Bob
I had tried lots of formatting but forgot about declaring variable I do

not
decale much as macros seem to work without but obviously more important

than
I thought must stop being lazy and use good practises
thanks again
Tina

"Bob Phillips" wrote:

Make sure that you declare MyDate as a Date variable.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"tina" wrote in message
...
Hi
I have a macro which request a date which is then used in an advanced

filter
My problem is the date seems to be american format mm/dd/yy but i need

uk
the cell g2 is formatted to dd/mm/yy but comes out as mm/dd/yy after
inputbox used
MYDATE = InputBox("ENTER DATE DD/MM/YY")
Range("G1") = "<="
Range("G2") = MYDATE
how do I format inputbox?
thanks Tina








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
InputBox a date Otto Moehrbach Excel Programming 6 April 12th 05 02:58 PM
Using Date in InputBox for criteria in code SMac Excel Programming 6 March 24th 05 07:48 PM
Inputbox to enter date Tom Ogilvy Excel Programming 0 July 27th 04 05:44 PM
Inputbox as Date andibevan Excel Programming 3 July 9th 04 02:15 PM
Date from InputBox Michael Excel Programming 3 May 26th 04 01:11 PM


All times are GMT +1. The time now is 01:54 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"