Semplificazione del codice



  • Semplificazione del codice
    di beppexile data: 16/11/2015 07:59:13

    Salve ragazzi, come suggeritomi da alcuni di voi, stamani mi sono messo ad apportare qualche modifica di semplificazione al mio file, ma ho un problema;

    dopo aver ridotto il codice sotto, ho scoperto che su excel 2010 non funzionava più, e l'ho dovuto rimettere come prima, qualcuno saprebbe dirmi dove ho sbagliato?

    Grazie  
     
    'codice prima della modifica
    
                Range("PARK_LOTTO").Select
                Selection.End(xlDown).Select
                rig = ActiveCell.Offset(1, 0).Row
                'PRODOTTO
                col = Range("PARK_PRODOTTO").Column
                Range("PARK_PRODOTTO").Copy
                Cells(rig, col).PasteSpecial
                'FORNITORE
                col = Range("PARK_FORNITORE").Column
                Range("PARK_FORNITORE").Copy
                Cells(rig, col).PasteSpecial
                'PESO
                col = Range("PARK_PESO_C").Column
                Range("PARK_PESO_C").Copy
                Cells(rig, col).PasteSpecial
                '...continua
    
    'codice dopo la semplificazione
    
                rig = Range("PARK_LOTTO").End(xlDown).Offset(1, 0).Row
                'PRODOTTO
                Range("PARK_PRODOTTO").Copy Cells(rig, Range("PARK_PRODOTTO").Column)
                'FORNITORE
                Range("PARK_FORNITORE").Copy Cells(rig, Range("PARK_FORNITORE").Column)
                'PESO
                Range("PARK_PESO").Copy Cells(rig, Range("PARK_PESO").Column)
                '...continua



  • di patel data: 16/11/2015 08:29:32

    prova così
     
                rig =Range("PARK_LOTTO").End(xlDown).Offset(1, 0).Row
                col = Range("PARK_PRODOTTO").Column
                Range("PARK_PRODOTTO").Copy  Cells(rig, col)
                'FORNITORE
                col = Range("PARK_FORNITORE").Column
                Range("PARK_FORNITORE").Copy  Cells(rig, col)
                'PESO
                col = Range("PARK_PESO_C").Column
                Range("PARK_PESO_C").Copy  Cells(rig, col)






  • di beppexile data: 16/11/2015 09:43:59

    Funziona, grazie!