part number changes to date

Microsoft Office excel 2007 - upgrade
November 9, 2010 at 16:33:10
Specs: Windows XP
We have part numbers for decals DEC-1 and DEC-12 and are linking into InDesign via Easy Catalog Creator which uses a .csv file for updates, but every time the file is reopened or resaved as a .csv, these part numbers change to a date and no longer link up. Is there a way to tell Excel not to do this?

See More: part number changes to date

Report •

November 9, 2010 at 17:27:00
A few suggestions...

1 - Format the cells as text before you enter Dec-1

2 - Use an apostrophe which forces Excel to read the data as text


3 - Use a formula in another cell:


The result will be treated as text.

4 - Use a WorksheetChange macro. This code will monitor Column A and if a date is entered, it will reformat it to what you want it to look like and leave it as text.

Private Sub Worksheet_Change(ByVal Target As Range)
'Disable event so this code doesn't
'fire when it changes the cell
 Application.EnableEvents = False
'Was the change made to Column A?
  If Target.Column = 1 Then
'If yes, was the entry a Date?
   If IsDate(Target) Then
'If yes, the format the date and store it ina variable
     myPN = _
       Format(Range(Target.Address), "mmm") _
                    & "-" & Day(Target)
'Set the cell format to text
     Range(Target.Address).NumberFormat = "@"
'Put the reformatted date back into the cell
     Range(Target.Address) = myPN
   End If
  End If
'Enable Events for next time.
 Application.EnableEvents = True
End Sub

Report •
Related Solutions

Ask Question