View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
Zebra Zebra is offline
external usenet poster
 
Posts: 1
Default option to prevent Excel changing 1-2-3 to a date

I agree that there should be an option to turn off the automatic Exel date
conversion.

Vince" wrote:

Nick and Gord

Thankyou for your help.
After copying and pasting many times, I have columns of data some of which
is in the correct format 1-2-3-4 (from 1-2-3-4 type pastes), some is in date
format 1-Feb (from 1-2 type pastes) and some is in date format 1/02/2003
(from 1-2-3 type pastes). The code suggested by Nick would presumably work
on some of these (1/02/2003) but what would happen to the others? Just to
confuse the issue the data is sometimes preceeded by an asterisk, *1-2,
*1-2-3, *1-2-3-4. I have no probem correcting this to another column
because this data is pasted unchanged.

Turning off the Excel feature seems to me to be a much better approach if
that is possible. Alternatively I could first make a text file and edit it
to include an apostrophe in all cases and then read it into Excel. This is
a lot of work.

Surely Excel should be designed with an option to accept any character
string without change.

Kind regards

Vince


The page is currently unavailable
Due to current high demand, the page you are looking for cannot be delivered
right now.
________________________________________
Please click the Refresh button, or try again later.

HTTP Error 408 / 409 - Not acceptable / Resource conflict
Internet Explorer

Fortunately I copied it to Word first
Second attempt at posting

--
Vince


"Nick Hodge" wrote:

Vince

Having looked at it, I would lobby the website to change from frames...It's
ugly!

Gord's answer won't work as the frame you want to extract data from is not
even recognised by Excel, I guess as it's buried in many others

I think your best bet is to put this code in your personal.xls and select
the cells and it will change them to the correct format.

Excel has it's failings, but you can get around the 'sniffing' of data types
in many ways, just not when it's buried in ugly frames.

Here is the code that should work (Select the cell first)

Sub changeDateToOdds()
Dim first As String
Dim second As String
Dim third As String
first = Day(ActiveCell.Text)
second = Month(ActiveCell.Value)
third = Val(Right(Year(ActiveCell.Value), 2))
ActiveCell.NumberFormat = "@"
ActiveCell.Value = CStr(first & "-" & second & "-" & third)
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"Vince" wrote in message
...
Gordon

To get the data that I copy and paste

go to the site
Click on Racing
Click on results & search
Pick a date eg 8 jul 2006 Racing click on RESULTS
Click on a race eg EAGLE FARM BR1
one line of data data includes 9-2-4 10-7-2
Click on EAGLE FARM BR6
data includes 8-10-13-5 8-10-13-11
Click on GOLD COAST QR1
data includes 10-1-3 "blank"
Sometimes the data is limited to 10-1

I will check out your suggestion later today. The Tennis is just
finished
and I must go to bed. just after 2am in Oz.

kind regards

--
Vince


"Vince" wrote:


--
Vince

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the
"I
Agree" button in the message pane. If you do not see the button, follow
this
link to open the suggestion in the Microsoft Web-based Newsreader and
then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc