Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default dates are formatted as custom date but still display as numbers

I have inherited a spreadsheet which was originally created in XP and have
now converted to 2007. I have a column of dates which have suddenly changed
to general format. I've tried re-formatting them but they just won't change
to date format. I've found that it has the following macro. Is there
something that should be changed?

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 248
Default dates are formatted as custom date but still display as numbers

Looks like your dates are formatted as TEXT
Enter 1 in any empty cell
Copy it
Select your cells with dates
Right-click and choose Paste Special and then choose Multiply
Click OK
Then format your cells as DATE
--
Pl click the YES button
(if you see it - don''''''''t worry if you don''t),
if this answer was helpful.



"Trainer" wrote:

I have inherited a spreadsheet which was originally created in XP and have
now converted to 2007. I have a column of dates which have suddenly changed
to general format. I've tried re-formatting them but they just won't change
to date format. I've found that it has the following macro. Is there
something that should be changed?

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default dates are formatted as custom date but still display as numbers

Before you use a macro, what do you see in the formulabar?

Do you see a number or do you see a date?

If you see a number, then try formatting the cells as a date once more.

But if you see a date, then you may be looking at formulas.

In xl2003 menus, Tools|Options|View tab|uncheck formulas.

This is under that Office button|Excel options some where!

But you can also use a shortcut key stroke:
ctrl-` (control-backquote, the key just to the left of the 1/! on my USA
keyboard)

Trainer wrote:

I have inherited a spreadsheet which was originally created in XP and have
now converted to 2007. I have a column of dates which have suddenly changed
to general format. I've tried re-formatting them but they just won't change
to date format. I've found that it has the following macro. Is there
something that should be changed?

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Numbers being Auto Date Formatted Kirk V-burg Excel Discussion (Misc queries) 0 September 9th 08 07:28 PM
Formula to count number of time stamps within a range in a column having dates formatted as "custom" Sam Excel Discussion (Misc queries) 3 June 19th 07 12:33 AM
how do I concatenate custom formatted numbers Sloth Excel Worksheet Functions 0 November 29th 06 03:34 PM
how do I concatenate custom formatted numbers RobynP Excel Worksheet Functions 0 November 29th 06 03:15 PM
Convert hard keyed/formatted numbers to dates MarvInBoise Excel Worksheet Functions 4 November 14th 06 06:45 PM


All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"