don't autoformat, treat date as text

shantanuo

New Member
Joined
Apr 13, 2003
Messages
25
Hi,
Is there any option, if selected will treat all dates as plain text?
I know I can use ' (Single quot) to treat it as text.
My problem is that I don't remember to use it while I am typing.
Is there any option in tools?

Shantanu Oak
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
It can be done quite easily.

Highlight the column with the dates. From the Data drop down menu, select Text To Columns. This works very much like the Import Wizard. Click Next twice until you come to the Column Data Format section. Select the "Text" radio button and click Finish. Your dates should now be converted to strings (text).
 
Upvote 0
Hi,
Thanks. But Only a part of my problem solved.
This tip can be used only for a single column.
What about if I want to update the entire sheet?

Shantanu Oak
 
Upvote 0
If you have just a few columns, it should be easy enough to do each manually. If you have numerous colulmns, here is some code I wrote to repeat the Text to Columns for all columns that have data in Row 1:

Code:
Sub FixAllColumns()

    Application.ScreenUpdating = False
    
    Dim MyLastColumnAddress As String
    Dim i As Integer
    
    MyLastColumnAddress = Range("IV1").End(xlToLeft).Address
    
    Range("A1").Select
    Do
        On Error Resume Next
        i = i + 1
        Cells(1, i).Select
        Range(Cells(1, i), Cells(65536, i)).Select
        Selection.TextToColumns Destination:=Cells(1, i), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
            Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
            :=Array(1, 2)
       If ActiveCell.Address = MyLastColumnAddress Then Exit Do
    Loop
    
    On Error GoTo 0
    
    Application.ScreenUpdating = True

End Sub

P.S. I edited the code to account for any blank columns.
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

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