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

    why error... (2000 sr 1)

    i use this condition but have error "type not correspondent":

    If ELENCO.Range("I" + CONT).Value <> "" Then
    ELENCO.Range("AF" + CONT).Value = (ELENCO.Range("I" + CONT).Value) - (ELENCO.Range("G" + CONT).Value)
    End If

    in column I have format cell gg/mm/aaaa (I3=23/11/2005) in column G format cell TEXT (G3=03/10/2005)...
    in effect i would want to have difference in days...

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

    Re: why error... (2000 sr 1)

    Why error? Because text is not the same as a date. Try

    ELENCO.Range("AF" & CONT).Value = CDate(ELENCO.Range("I" & CONT).Value) - CDate(ELENCO.Range("G" & CONT).Value)

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: why error... (2000 sr 1)

    Have you tried assigning the calc to a variable:
    Test = (ELENCO.Range("I" + CONT).Value) - (ELENCO.Range("G" + CONT).Value)
    ELENCO.Range("AF" + CONT).Value =Test
    Regards,
    Rudi

Posting Permissions

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