Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
InputBox a date | Excel Programming | |||
Using Date in InputBox for criteria in code | Excel Programming | |||
Inputbox to enter date | Excel Programming | |||
Inputbox as Date | Excel Programming | |||
Date from InputBox | Excel Programming |