Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 65
Default Insert ' sign infront of dates

Hi!

i have the current visable values

May-06
Jun-06
Jul-06
Aug-06

How do I insert ' (Quote sign) in front of dates in Col A so the underlying
values

01/05/2006
01/06/2006
01/07/2006
01/08/2006

becomes the visable values

'01/05/2006
'01/06/2006
'01/07/2006
'01/08/2006

Thanks In advance

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200609/1

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Insert ' sign infront of dates

On Thu, 28 Sep 2006 11:07:09 GMT, "FIRSTROUNDKO via OfficeKB.com" <u15639@uwe
wrote:

Hi!

i have the current visable values

May-06
Jun-06
Jul-06
Aug-06

How do I insert ' (Quote sign) in front of dates in Col A so the underlying
values

01/05/2006
01/06/2006
01/07/2006
01/08/2006

becomes the visable values

'01/05/2006
'01/06/2006
'01/07/2006
'01/08/2006

Thanks In advance


Difficult without VBA.

However, you could:

1. Format/Cells/Number/Custom Type: dd/mm/yyyy

or use the formula in an adjacent column:

=TEXT(A1,"dd/mm/yyyy")


--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 115
Default Insert ' sign infront of dates

Hi,

Format -- Cells...

Number Tab

Custom Format

Enter the next line as the format
"'" d-mm-yy

Ed Ferrero
Microsoft Excel MVP
http://www.edferrero.com


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 65
Default Insert ' sign infront of dates

Ron

I dont mind using VBA

Thanks

Darren

Ron Rosenfeld wrote:
Hi!

[quoted text clipped - 21 lines]

Thanks In advance


Difficult without VBA.

However, you could:

1. Format/Cells/Number/Custom Type: dd/mm/yyyy

or use the formula in an adjacent column:

=TEXT(A1,"dd/mm/yyyy")

--ron


--
Message posted via http://www.officekb.com

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default Insert ' sign infront of dates

This code will do it: paste this in as a macro, then highlight the
range of dates in question and run.

Sub Add_Apostrophe()
Dim rCell As Range

For Each rCell In Selection.Cells
rCell.Value = "'"& rcell.value
Next rCell
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Insert ' sign infront of dates

On Thu, 28 Sep 2006 12:26:29 GMT, "FIRSTROUNDKO via OfficeKB.com" <u15639@uwe
wrote:

Ron

I dont mind using VBA

Thanks

Darren


The simplest way would be to format the cells the way I suggested unless you
absolutely require a text string instead of an Excel recognizable date.

Does the formatting not provide you with what you want? For most purposes, I
would have thought that would be better.

If that is not a better solution, you could do what you want with a VBA macro:

=========================
Option Explicit

Sub FormatDate()
Dim c As Range
For Each c In Selection
If IsDate(c.Value) Then
c.Value = "'" & Format(c.Value, "dd/mm/yyyy")
End If
Next c
End Sub
=======================

Of course, the dates would now be text strings and not easily usable by Excel
as dates. They might seem to be usable, but how they would be interpreted
would be dependent on the Windows Regional Settings.

In other words, on my (US-centric) machine, '01/05/06' would be interpreted as
5 Jan 2006; On a different machine, it might be interpreted as 1 May 2006.
--ron
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
calculating number of three month periods between two dates... neil Excel Discussion (Misc queries) 3 May 21st 06 01:52 PM
formula to add dates. S S Excel Worksheet Functions 8 April 5th 06 07:53 PM
PivotTables - Group Dates, excluding dates Todd1 Excel Discussion (Misc queries) 4 December 10th 05 05:06 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM
2 digit year in dates return 19xx not 20xx moranbo Excel Discussion (Misc queries) 1 September 7th 05 01:44 AM


All times are GMT +1. The time now is 11:13 AM.

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

About Us

"It's about Microsoft Excel"