VBA .numberformat="@"

Robert Evans

New Member
Joined
Jun 14, 2011
Messages
3
Does anyone know how to fix this?

I have two values in delimited file
133-145 and 7-60

when I apply .numberformat="@"
133-145 works correctly

but 7-60 becomes 22098 which is the date value for July 1, 1960

Is there anyway that I can stop this from happing?
I really need it to stay 7-60

btw: these values do not have quotes around them and I do not have control of the incoming data format

thanks much for any help here
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
If you can't control the import (which would be a better solution), then you can use a formula in another column:

=text(a1, "m-yy")

Then copy and paste values over the original column.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,735
Members
452,939
Latest member
WCrawford

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