Date Format works for one column, but not the other

crumbcounter

New Member
Joined
Sep 27, 2016
Messages
11
Hello one of two lines are not working in Macro


Columns("C:C").NumberFormat = "[$-x-sysdate]dddd, mmmm dd, yyyy"
Columns("D:D").NumberFormat = "[$-x-sysdate]dddd, mmmm dd, yyyy"


Only works for column C. I have tried combining the lines "C:D", reversing order, and only having line for D. Column D is not reformatting. Any clues?


Task
ResourcesStart DateEnd DateStatus
Addresses, Dates, Contact Info, Drawings, Drops, and Other InfoBen Gallahan29-Nov-1608/May/2017Upcoming
Set up RecyclingBen Gallahan31-Mar-1714/Apr/2017Overdue
IT Presence Book Flight and Hotelhelpdesk14-Apr-1718/Apr/2017Upcoming
IT Building AccessBen Gallahan31-Mar-1721/Apr/2017Upcoming
IT Suite AccessBen Gallahan31-Mar-1721/Apr/2017Upcoming
Give IT Presence Schedule and ContactsBen Gallahan14-Apr-1721/Apr/2017Upcoming
Make sure Workstation items are sent to current officeBen Gallahan14-Apr-1723/Apr/2017Upcoming

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
What happens with the below?

Code:
Columns("D:D").Replace What:="/", Replacement:="-", LookAt:=xlPart
Columns("C:D").NumberFormat = "[$-x-sysdate]dddd, mmmm dd, yyyy"
 
Upvote 0
What happens with the below?

Code:
Columns("D:D").Replace What:="/", Replacement:="-", LookAt:=xlPart
Columns("C:D").NumberFormat = "[$-x-sysdate]dddd, mmmm dd, yyyy"


Figured out the problem. Sorry for wasting your time. Problem was with another part of the macro.


Columns("F:F").Select
Selection.TextToColumns Destination:=Range("F1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 3), TrailingMinusNumbers:=True


Columns("J:J").Select
Selection.TextToColumns Destination:=Range("I1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 3), TrailingMinusNumbers:=True


I will be experimenting with outlook integration. Will probably have problems. Ill post under new thread. Thanks again
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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