Macro paste to web form in wrong date format

ClimoC

Well-known Member
Joined
Aug 21, 2009
Messages
584
Hello,
My macro takes the value of a range of dates in dd/mm/yy format, and puts the date into a text field of a web form in IE, (also does some other copying-pasting)then submits the form. Problem is it pastes in American format - mm/dd/yy and this is incorrect for the webform.

I've tried manually typing the date into the field (as oppose to using the javascript calendar on the text field) and submitted, and the date is fine.

It is during the process of going from Excel to IE that the dates all get their numberformatting switched.

How can I tell excel to keep the numberformat as "dd/mm/yy"? I have been told that Office 2007 hates English dd/mm/yy format, but I'm in Excel 2003

Any help would be much appreciated

the bit where it assigns the value of the cell in the range is here (fields that are in dd/mm/yy numberformat are RED:
Rich (BB code):
If TestcheckBox = True Then
        ProTitle = Range("I" & R).Value
        DurationTime = Range("Z" & R).Value
        TransStart = Range("M" & R).Value
        TransEnd = Range("M" & R).Value + 1
        LineTX = Left(Range("L" & R).Value, 9)
        VisFrom = Range("N" & R).Value
        VisTo = Range("P" & R).Value
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
If the 'date' is formatted as you want use Text not Value.
 
Upvote 0
Stunner!

One thing - the line that reads Range("M" & ReviewRow).Value +1

In other words that which takes a date and adds one day onto it.

How do I still do this "+1" element and make it text?

Cheers
C
 
Upvote 0
There is no line that reads like that in your posted code.:)
 
Upvote 0
I beg your pardon - it's Range("M" & R).Value +1

R is set as reviewrow earlier in the code
 
Upvote 0

Forum statistics

Threads
1,226,217
Messages
6,189,687
Members
453,563
Latest member
Aswathimsanil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top