+ Reply to Thread
Results 1 to 2 of 2

How Can I conver date i.e 18/11/2005 to 18112005.?

  1. #1
    Manish Patel
    Guest

    How Can I conver date i.e 18/11/2005 to 18112005.?

    Hi

    I am doing one Pruchase Order form in Excel.

    I want to creat the PO number as if date being Displayed in regular number.
    i.e 18/11/2005 as if 18112005 and than followed by "-" and increasing value.

    If I will open and print off 5 times in a day. The last number has to be
    18112005-5.

    Is there anybody can help me on it.

    Kind Regards

    Manish



  2. #2
    chijanzen
    Guest

    RE: How Can I conver date i.e 18/11/2005 to 18112005.?

    Manish :

    reference Workbook_BeforePrint

    add this code to Thisworkbook

    if range("A1") is empty


    'Thisworkbook
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    If Range("A1") = "" Then
    n = 1
    Else
    s = VBA.Split(Range("A1"), "-")
    n = s(1) + 1
    End If
    Range("A1") = VBA.Format(Date, "ddmmyy") & "-" & n
    End Sub



    --
    天行健,君*以自強不息
    地勢坤,君*以厚德載物

    http://www.vba.com.tw/plog/


    "Manish Patel" wrote:

    > Hi
    >
    > I am doing one Pruchase Order form in Excel.
    >
    > I want to creat the PO number as if date being Displayed in regular number.
    > i.e 18/11/2005 as if 18112005 and than followed by "-" and increasing value.
    >
    > If I will open and print off 5 times in a day. The last number has to be
    > 18112005-5.
    >
    > Is there anybody can help me on it.
    >
    > Kind Regards
    >
    > Manish
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1