PC Review


Reply
Thread Tools Rate Thread

Change dates from dd/mm/yy to 6 digits being ddmmyy

 
 
Stuart
Guest
Posts: n/a
 
      17th Apr 2007
The subject line is exactly what I need,

I do not want the dates to have any characters between them. I just
literally want six digits.

Our system cannot accept character only numberics.

If a macro could do this that would be amazing,

Let me know,

Thanks

Stuart

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmF5?=
Guest
Posts: n/a
 
      17th Apr 2007
Hi Stuart -

It sounds like the Replace function might work for you. Here is a
demonstration procedure:

Sub Stuart()
Const dt = "14/03/07"
new_dt = Replace(dt, "/", "")
MsgBox new_dt
End Sub

---
Jay


"Stuart" wrote:

> The subject line is exactly what I need,
>
> I do not want the dates to have any characters between them. I just
> literally want six digits.
>
> Our system cannot accept character only numberics.
>
> If a macro could do this that would be amazing,
>
> Let me know,
>
> Thanks
>
> Stuart
>
>

 
Reply With Quote
 
Mark Lincoln
Guest
Posts: n/a
 
      17th Apr 2007
On Apr 17, 3:06 pm, Stuart <swilson2...@gmail.com> wrote:
> The subject line is exactly what I need,
>
> I do not want the dates to have any characters between them. I just
> literally want six digits.
>
> Our system cannot accept character only numberics.
>
> If a macro could do this that would be amazing,
>
> Let me know,
>
> Thanks
>
> Stuart



Change the cell formatting to "ddmmyy".

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      17th Apr 2007
You have to help excel a little bit--by typing in those slashes/dashes so that
excel knows that it's a date.

But after that, you can format the cell/range anyway you want including:

ddmmyy

The underlying value will still be a date, but it'll look the way you want.

Stuart wrote:
>
> The subject line is exactly what I need,
>
> I do not want the dates to have any characters between them. I just
> literally want six digits.
>
> Our system cannot accept character only numberics.
>
> If a macro could do this that would be amazing,
>
> Let me know,
>
> Thanks
>
> Stuart


--

Dave Peterson
 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      17th Apr 2007
Stuart

Not a macro but you could probably develop one from this.

=1000000+(YEAR(A1)-2000)*10000+MONTH(A1)*100+DAY(A1)


Gord Dibben MS Excel MVP

On 17 Apr 2007 12:06:08 -0700, Stuart <(E-Mail Removed)> wrote:

>The subject line is exactly what I need,
>
>I do not want the dates to have any characters between them. I just
>literally want six digits.
>
>Our system cannot accept character only numberics.
>
>If a macro could do this that would be amazing,
>
>Let me know,
>
>Thanks
>
>Stuart


 
Reply With Quote
 
Stuart
Guest
Posts: n/a
 
      17th Apr 2007
I cannot get any of the above suggestions to work. When I change the
date formatting to ddmmyy it does not work for anything above
04/12/2007

Is this something someone can help with?

Kind Regards

Stuart







On 17 Apr, 20:38, Gord Dibben <gorddibbATshawDOTca> wrote:
> Stuart
>
> Not a macro but you could probably develop one from this.
>
> =1000000+(YEAR(A1)-2000)*10000+MONTH(A1)*100+DAY(A1)
>
> Gord Dibben MS Excel MVP
>
> On 17 Apr 2007 12:06:08 -0700, Stuart <swilson2...@gmail.com> wrote:
>
>
>
> >The subject line is exactly what I need,

>
> >I do not want the dates to have any characters between them. I just
> >literally want six digits.

>
> >Our system cannot accept character only numberics.

>
> >If a macro could do this that would be amazing,

>
> >Let me know,

>
> >Thanks

>
> >Stuart- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
Mark Lincoln
Guest
Posts: n/a
 
      17th Apr 2007
I'm guessing from your original post that you're entering dates into
cells. Is this true? If not, ignore me. Otherwise...

If I change a cell's format to ddmmyy and enter 4-17-07, the cell
displays 170407. What do you see?

On Apr 17, 3:45 pm, Stuart <swilson2...@gmail.com> wrote:
> I cannot get any of the above suggestions to work. When I change the
> date formatting to ddmmyy it does not work for anything above
> 04/12/2007
>
> Is this something someone can help with?
>
> Kind Regards
>
> Stuart
>
> On 17 Apr, 20:38, Gord Dibben <gorddibbATshawDOTca> wrote:
>
>
>
> > Stuart

>
> > Not a macro but you could probably develop one from this.

>
> > =1000000+(YEAR(A1)-2000)*10000+MONTH(A1)*100+DAY(A1)

>
> > Gord Dibben MS Excel MVP

>
> > On 17 Apr 2007 12:06:08 -0700, Stuart <swilson2...@gmail.com> wrote:

>
> > >The subject line is exactly what I need,

>
> > >I do not want the dates to have any characters between them. I just
> > >literally want six digits.

>
> > >Our system cannot accept character only numberics.

>
> > >If a macro could do this that would be amazing,

>
> > >Let me know,

>
> > >Thanks

>
> > >Stuart- Hide quoted text -

>
> > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
Stuart
Guest
Posts: n/a
 
      17th Apr 2007
On 17 Apr, 20:55, Mark Lincoln <mlinc...@earthlink.net> wrote:
> I'm guessing from your original post that you're entering dates into
> cells. Is this true? If not, ignore me. Otherwise...
>
> If I change a cell's format to ddmmyy and enter 4-17-07, the cell
> displays 170407. What do you see?
>
> On Apr 17, 3:45 pm, Stuart <swilson2...@gmail.com> wrote:
>
>
>
> > I cannot get any of the above suggestions to work. When I change the
> > date formatting to ddmmyy it does not work for anything above
> > 04/12/2007

>
> > Is this something someone can help with?

>
> > Kind Regards

>
> > Stuart

>
> > On 17 Apr, 20:38, Gord Dibben <gorddibbATshawDOTca> wrote:

>
> > > Stuart

>
> > > Not a macro but you could probably develop one from this.

>
> > > =1000000+(YEAR(A1)-2000)*10000+MONTH(A1)*100+DAY(A1)

>
> > > Gord Dibben MS Excel MVP

>
> > > On 17 Apr 2007 12:06:08 -0700, Stuart <swilson2...@gmail.com> wrote:

>
> > > >The subject line is exactly what I need,

>
> > > >I do not want the dates to have any characters between them. I just
> > > >literally want six digits.

>
> > > >Our system cannot accept character only numberics.

>
> > > >If a macro could do this that would be amazing,

>
> > > >Let me know,

>
> > > >Thanks

>
> > > >Stuart- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -



Hi there,

When I key in "4-17-07" I still see "4-17-07" even after formatting to
ddmmyy.

I am keying the dates in at the moment to test this however the data
will be pasted in from a text dump and there will be no manual keying
in of the dates.

I just want to be able to format it the way I need to see the data.

Stuart

 
Reply With Quote
 
Mark Lincoln
Guest
Posts: n/a
 
      17th Apr 2007
Stuart,

Here's a (very) quick-and-dirty bit of code:

Sub DoIt()
Dim S As String
Open "C:\testfile.txt" For Input As #1
S = Input(6, #1)
Close #1
Range("A1") = S
End Sub

Cell A1 was first formatted as Text. I've assumed the input from your
system is in the format you're describing, so testfile.txt contains
the string 050407 (or April 5, 2007). The result of the code is that
Cell A1 contains 050407, just as the input string does.

So the short answer, if my assumptions are correct, is to format your
date field(s) as Text before importing your data.

Does this help?

Mark

On Apr 17, 3:58 pm, Stuart <swilson2...@gmail.com> wrote:
> On 17 Apr, 20:55, Mark Lincoln <mlinc...@earthlink.net> wrote:
>
>
>
>
>
> > I'm guessing from your original post that you're entering dates into
> > cells. Is this true? If not, ignore me. Otherwise...

>
> > If I change a cell's format to ddmmyy and enter 4-17-07, the cell
> > displays 170407. What do you see?

>
> > On Apr 17, 3:45 pm, Stuart <swilson2...@gmail.com> wrote:

>
> > > I cannot get any of the above suggestions to work. When I change the
> > > date formatting to ddmmyy it does not work for anything above
> > > 04/12/2007

>
> > > Is this something someone can help with?

>
> > > Kind Regards

>
> > > Stuart

>
> > > On 17 Apr, 20:38, Gord Dibben <gorddibbATshawDOTca> wrote:

>
> > > > Stuart

>
> > > > Not a macro but you could probably develop one from this.

>
> > > > =1000000+(YEAR(A1)-2000)*10000+MONTH(A1)*100+DAY(A1)

>
> > > > Gord Dibben MS Excel MVP

>
> > > > On 17 Apr 2007 12:06:08 -0700, Stuart <swilson2...@gmail.com> wrote:

>
> > > > >The subject line is exactly what I need,

>
> > > > >I do not want the dates to have any characters between them. I just
> > > > >literally want six digits.

>
> > > > >Our system cannot accept character only numberics.

>
> > > > >If a macro could do this that would be amazing,

>
> > > > >Let me know,

>
> > > > >Thanks

>
> > > > >Stuart- Hide quoted text -

>
> > > > - Show quoted text -- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> > - Show quoted text -

>
> Hi there,
>
> When I key in "4-17-07" I still see "4-17-07" even after formatting to
> ddmmyy.
>
> I am keying the dates in at the moment to test this however the data
> will be pasted in from a text dump and there will be no manual keying
> in of the dates.
>
> I just want to be able to format it the way I need to see the data.
>
> Stuart- Hide quoted text -
>
> - Show quoted text -



 
Reply With Quote
 
David G
Guest
Posts: n/a
 
      17th Apr 2007
On Apr 17, 3:58 pm, Stuart <swilson2...@gmail.com> wrote:
> When I key in "4-17-07" I still see "4-17-07" even after formatting to
> ddmmyy.


I think the problem you are experiencing is because Excel does not
recognize 4-17-07 as a date, probably because the date settings in
your Control Panel indicate that dates should be in the format dd-mm-
yy rather than mm-dd-yy. Try entering 17-4-7 and see if that gets
formatted correctly.

Cheers,
David G

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA write macro change column with 3 number digits to 4 digits the James C Microsoft Excel Misc 3 25th Jan 2010 03:12 PM
How do you change single digits to recognized double digits? Evil with a K Microsoft Excel Worksheet Functions 6 18th May 2009 09:19 PM
How do you change single digits to recognized double digits? Evil with a K Microsoft Excel Worksheet Functions 0 18th May 2009 09:05 PM
Re: Digits in Dates changing Andy B Microsoft Excel Misc 0 23rd Sep 2003 05:05 PM
Re: Digits in Dates changing J.E. McGimpsey Microsoft Excel Misc 0 23rd Sep 2003 04:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:35 AM.