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

    copy also into LISTA shett (2000 sr 1)

    ... this macro copy variuos records into sheets based year and month. (tks to Hans, my teacher!)
    My problem:
    Is possible to copy the same value copyed into the variuos sheets also into a general sheet named LISTA?
    (add up naturally)

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

    Re: copy also into LISTA shett (2000 sr 1)

    Immediately above the lines

    'Avanzamento record nell'elenco
    N = N + 1

    insert this:

    Dim lngRow As Long
    lngRow = Sheets("LISTA").Range("A65536").End(xlUp).Row + 1
    Elenco.Range("A" & N).EntireRow.Copy Destination:=Sheets("LISTA").Range("A" & lngRow)

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

    Re: copy also into LISTA shett (2000 sr 1)

    Sorry Hans but i have insert your line in:

    .............
    End If
    'Avanzamento contatore nel Display
    Elenco.Range("D1").Value = N - 2
    'Avanzamento record nell'elenco
    N = N + 1

    'COPIA IN SHEET LISTA
    lngRow = Sheets("LISTA").Range("A65536").End(xlUp).Row + 1
    Elenco.Range("A" & N).EntireRow.Copy Destination:=Sheets("LISTA").Range("A" & lngRow)
    'COPIA IN SHEET LISTA

    End If
    Loop
    ...........

    but the record not is added into LISTA sheet.... peraphs is a problem with the count routine N = N+1 ecc...

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

    Re: copy also into LISTA shett (2000 sr 1)

    I wrote
    <hr>Immediately above the lines<hr>
    You have inserted the code below them.

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

    Re: copy also into LISTA shett (2000 sr 1)

    <img src=/S/bash.gif border=0 alt=bash width=35 height=39> <img src=/S/bash.gif border=0 alt=bash width=35 height=39> , sure i am a stupid, sorry Hans.

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

    Re: copy also into LISTA shett (2000 sr 1)

    Hans i have see into sheet LISTA, after 41 disk imported the record is out 65536 acccccccc.....
    I import other 23 disk...
    My idea:
    if i make 2 separate sheet named LISTA2004 and LISTA_2005 is possible to modifie your code with a condition to define where the record must copied based year?

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

    Re: copy also into LISTA shett (2000 sr 1)

    You can adapt the code from the thread about Create sheet in base of month... (2000 sr 1) for this.

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

    Re: copy also into LISTA shett (2000 sr 1)

    Hans i have make this and macro work correct, wath you think about your sudent?

    If Mid(Record_Corrente, 9, 2) = "HR" Then
    Data_Disk = Mid(Record_Corrente, 79, 2) + "/" + Mid(Record_Corrente, 81, 2) + "/" + Mid(Record_Corrente, 83, 4)
    dtmDate = DateSerial(Mid(Record_Corrente, 83, 4), Mid(Record_Corrente, 81, 2), Mid(Record_Corrente, 79, 2))
    strSheet = UCase(Format(dtmDate, "MMMM_YYYY"))
    TITOLO_DATA = UCase(Format(dtmDate, "MMMM_YYYY"))
    ''''''''''''
    SELECT_YEAR_SHEET = UCase(Format(dtmDate, "YYYY"))
    '''''''''''
    On Error Resume Next
    Set Elenco = Worksheets(strSheet)

    .................
    'COPIA IN SHEET LISTA
    If SELECT_YEAR_SHEET = 2005 Then
    lngRow = Sheets("LISTA_2005").Range("A65536").End(xlUp).Row + 1
    Elenco.Range("A" & N).EntireRow.Copy Destination:=Sheets("LISTA_2005").Range("A" & lngRow)
    Else
    lngRow = Sheets("LISTA_2004").Range("A65536").End(xlUp).Row + 1
    Elenco.Range("A" & N).EntireRow.Copy Destination:=Sheets("LISTA_2004").Range("A" & lngRow)
    End If
    'COPIA IN SHEET LISTA
    ..................

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

    Re: copy also into LISTA shett (2000 sr 1)

    If it works in a test, that's fine.

    If you also need to do this next year, it would be best to use a variable for the year, so that you don't have to write new lines for 2006.

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

    Re: copy also into LISTA shett (2000 sr 1)

    Good note...
    Tks.

    Note:
    remember my last year message: Hans(active cell 10,10) sal(active cell 0,0), wath is today my active cell? <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30> ?

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

    Re: copy also into LISTA shett (2000 sr 1)

    <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

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

    Re: copy also into LISTA shett (2000 sr 1)

    ... sure, your smile is a good big gift for me!

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

    Re: copy also into LISTA shett (2000 sr 1)

    ... But is possible to use this part of code to recopy line also into sheet FIPO_TOTALE referenig the macro? (Attached)

    Where i insert the code line, and i can use without correction?

    Dim lngRow As Long
    lngRow = Sheets("FIPO_TOTALE").Range("A65536").End(xlUp).Ro w + 1
    Elenco.Range("A" & N).EntireRow.Copy Destination:=Sheets("FIPO_TOTALE").Range("A" & lngRow)

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

    Re: copy also into LISTA shett (2000 sr 1)

    Insert the code immediately above these lines at the end of PROSSIMO:

    FASE = 0
    End If
    End Sub

    and change Elenco.Range("A" & N) to Foglio1.Range("A" & CONT)

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

    Re: copy also into LISTA shett (2000 sr 1)

    Perfect...

Posting Permissions

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