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

    Replicate name if... (2000 sr 1)

    With the attached macro i import a txt file, all is OK, but...
    Naturally i have a problem...;-)
    If you see the .epf file, for example after the line 61 (DE LIETO COSTRUZIONI GENERALI SP...) is present a blank line... in effect the blank line is refered to the line 61... is possible to recopy the same var until the frirst line not is changed?

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

    Re: Replicate name if... (2000 sr 1)

    Replace the lines

    Foglio1.Range("D" & cont).Value = var_COPE
    Foglio1.Range("E" & cont).Value = var_NOMINATIVO

    with

    If Trim(var_COPE) = "" Then
    Foglio1.Range("D" & cont).Value = Foglio1.Range("D" & (cont - 1)).Value
    Else
    Foglio1.Range("D" & cont).Value = var_COPE
    End If
    If var_NOMINATIVO = "" Then
    Foglio1.Range("E" & cont).Value = Foglio1.Range("E" & (cont - 1)).Value
    Else
    Foglio1.Range("E" & cont).Value = var_NOMINATIVO
    End If

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

    Re: Replicate name if... (2000 sr 1)

    Brilliant...
    and good the solution "cont-1"
    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
  •