Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does the date toggle between formats
I have the following code that updates a sheet on change to convert (fix)
dates to DMY. Occassionally the sheet will be updated again if the user makes a second update (an infrequent event). On the second update the format will change to MDY. I tested this by repeatedly running the macro and can see the dates toggle back and forth. Does anyone have any idea why or how I can fix it to DMY no matter how many times it's activated? Dim ColsToFix As Variant Dim TypeOfCols As Variant Dim iCol As Long ColsToFix = Array("G", "E", "C", "K", "M", "Q", "R", "S", "U", "W") TypeOfCols = Array(4, 1, 1, 1, 1, 1, 1, 1, 1, 1) If UBound(TypeOfCols) < UBound(ColsToFix) Then MsgBox "design error!-Cols & Types not matched" Exit Sub End If With ActiveSheet For iCol = LBound(ColsToFix) To UBound(ColsToFix) .Cells(1, ColsToFix(iCol)).EntireColumn.TextToColumns _ DataType:=xlDelimited, _ FieldInfo:=Array(1, TypeOfCols(iCol)) Next iCol End With -- Jim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date Formats | Excel Discussion (Misc queries) | |||
Dealing with date formats on expiration date | Excel Programming | |||
Date Formats | Excel Discussion (Misc queries) | |||
date formats | Excel Discussion (Misc queries) | |||
Date formats | Excel Discussion (Misc queries) |