Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    inseret number serial date (2000 sr 1)

    I insert a value into column H with the line
    Sheets("RATIFICHE").Range("H" + RIGA5) = GG & "/" & MM & "/" & AA

    Is possible to inseret in column I the serial number of date?

    Note:The var GG MM and AA are string and the column H is in text format.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: inseret number serial date (2000 sr 1)

    Sheets("RATIFICHE").Range("H" + RIGA5) = DateValue(GG & "/" & MM & "/" & AA)

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: inseret number serial date (2000 sr 1)

    but you intend (column I)
    Sheets("RATIFICHE").Range("I" + RIGA5) = DateValue(GG & "/" & MM & "/" & AA)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: inseret number serial date (2000 sr 1)

    Yeah, of course.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: inseret number serial date (2000 sr 1)

    in effect my idea is to order date into column H.
    The value in H are in text format and i want to maintain the format.
    I have used this is correct for you:
    Sub ORDINA()
    Application.ScreenUpdating = False
    Range(Range("H5"), Range("H5").End(xlDown)).Offset(0, 1).FormulaR1C1 = "=DATEVALUE(RC[-1])"
    Range(Range("A5:I5"), Range("A5:I5").End(xlDown)).Sort _
    Key1:=Range("A5"), Order1:=xlAscending, Key2:=Range("I5") _
    , Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
    Orientation:=xlTopToBottom
    Range("I5:I65536").ClearContents
    Application.ScreenUpdating = True
    End Sub

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: inseret number serial date (2000 sr 1)

    As far as I can tell, that code will fill column I with date values, sort the table on columns A and I, then clear column I. Why not leave the formulas in column I? You can hide column I, if you don't want the date values to be visible.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: inseret number serial date (2000 sr 1)

    good suggestion, i use this solution...
    tks.

Posting Permissions

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