Results 1 to 8 of 8

Thread: Formatting

  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    RngFind.Offset(0, 7) = RngFind.Offset(0, -4)

    RngFind.Offset(0, -4) is formatted as a date, how can I get RngFind.Offset(0, 7) also formatted the same?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    RngFind.Offset(0, 7).NumberFormat = RngFind.Offset(0, -4).NumberFormat

  3. #3
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks.

    What about:

    RngFind.Offset(0, 9) = "'" & RngFind.Offset(0, -2)

    RngFind.Offset(0, -2) is formatted as Greek ??? Don't know why, but shows 8 digits, some of which start 0.

    I need RngFind.Offset(0, 9) as text, without dropping the 0.

    The "'" does not work?

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

    RngFind.Offset(0, 9) = "'" & RngFind.Offset(0, -2).Text

  5. #5

  6. #6
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I now have a problem with a different kind of date. Please could somebody assist with the attached.

    Many Thanks

    [attachment=84728:Lounge_Dates.xls]
    Attached Files Attached Files

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The result of Format is a text value, not a date value. So you're setting the value of the cell to a text value! You should set it to a date.

    Change the line

    RngFind.Offset(0, 6) = Format(RngFind.Offset(0, -5), "dd/mm/yyyy")

    to

    RngFind.Offset(0, 6) = CDate(RngFind.Offset(0, -5))

    or

    RngFind.Offset(0, 6) = DateValue(RngFind.Offset(0, -5))

  8. #8
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='784990' date='16-Jul-2009 23:10']The result of Format is a text value.....[/quote]

    Aha, now If I could just store that somewhere upstairs!!!

    Thanks

Posting Permissions

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