View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trainer Trainer is offline
external usenet poster
 
Posts: 8
Default dates are formatted as custom date but still display as numbers

I have inherited a spreadsheet which has a column of dates but they are
displayed as numbers. When I click on the numbers, it shows them as date in
the formula bar and when I go into format it shows as a custom date format.
I've tried changing the format but they still show as numbers.

It looks as if someone's created the following macro (not good at macros).
What do I need to change to display the numbers as date?

Sub CreateDistributionForm()
'
' CreateDistributionForm Macro
' Macro recorded and updated by MONUC-HQ-ADC COS
'
' Keyboard Shortcut: Ctrl+Shift+F
'
idRow = ActiveCell.Row

With Worksheets("Incoming")
txtNum = Cells(idRow, 1).Value
txtRef = Cells(idRow, 2).Value
txtDate = Cells(idRow, 3).Value
txtSubject = Cells(idRow, 4).Value
txtFrom = Cells(idRow, 5).Value
End With

Worksheets("DistributionForm").Select
Range("E2").Value = txtNum
Range("A31").Value = txtRef
Range("A30").Value = txtDate
Range("D30") = txtSubject
Range("A32") = txtFrom
Range("A4") = Date


ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Worksheets("Incoming").Select

End Sub

--
Trainer