Moderatori: Anthony47, Flash30005
apprendistaIT ha scritto:E' molto probabile che abbia sbagliato io ad eseguire la macro
Sub CopiaF()
Sheets("Foglio3").Select
Cells.Select
Selection.Clear
Range("D10").Select
Sheets("Foglio4").Select
Cells.Select
Selection.Clear
Range("A1").Select
Sheets("Foglio1").Select
Cells.Select
Selection.Copy
Sheets("Foglio3").Select
Cells.Select
ActiveSheet.Paste
Range("A1").Select
Sheets("Foglio2").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Foglio4").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1").Select
Sheets("Foglio3").Select
End Sub
Sub ConfrontaEColora()
' Foglio1 Vecchio Catalogo
' Foglio2 Nuovo Catalogo
' Foglio3 Prodotti che non sono più nel nuovo catalogo
' Foglio4 Nuovi prodotti (non erano nel vecchio catalogo)
Call CopiaF
URS = Worksheets("Foglio1").Range("A" & Rows.Count).End(xlUp).Row '<<<< alias Foglio3
UCS = Worksheets("Foglio1").Range("IV2").End(xlToLeft).Column
Worksheets("Foglio3").Select
Worksheets("Foglio3").Range(Cells(2, 1), Cells(URS, UCS)).Interior.ColorIndex = 44
URA = Worksheets("Foglio2").Range("A" & Rows.Count).End(xlUp).Row '<<< alias Foglio4
UCA = Worksheets("Foglio2").Range("IV2").End(xlToLeft).Column
Worksheets("Foglio4").Select
Worksheets("Foglio4").Range(Cells(2, 1), Cells(URA, UCA)).Interior.ColorIndex = 6
For RS = 2 To URS
For RA = URA To 2 Step -1
For CS = 1 To UCA
If Worksheets("Foglio1").Cells(RS, CS).Value = Worksheets("Foglio4").Cells(RA, CS).Value Then Worksheets("Foglio4").Cells(RA, CS).Interior.ColorIndex = 0
Next CS
Next RA
Next RS
For RA = 2 To URA
For RS = URS To 2 Step -1
For CS = 1 To UCA
If Worksheets("Foglio2").Cells(RA, CS).Value = Worksheets("Foglio3").Cells(RS, CS).Value Then Worksheets("Foglio3").Cells(RA, CS).Interior.ColorIndex = 0
Next CS
Next RS
Next RA
End Sub
...
If Worksheets("Foglio1").Cells(RS, CS).Value = Worksheets("Foglio4").Cells(RA, CS).Value Then Worksheets("Foglio4").Cells(RA, CS).Interior.ColorIndex = 0
...
If Worksheets("Foglio2").Cells(RA, CS).Value = Worksheets("Foglio3").Cells(RS, CS).Value Then Worksheets("Foglio3").Cells(RA, CS).Interior.ColorIndex = 0
If Worksheets("Foglio2").Cells(RA, CS).Value = Worksheets("Foglio3").Cells(RS, CS).Value Then Worksheets("Foglio3").Cells(RA, CS).Interior.ColorIndex = xlNone
Sub ConfrontaEColora() '<<<<<Nome macro esistente
Application.ScreenUpdating = False '<<<<<< Riga da aggiungere
Application.Calculation = xlManual '<<<<<< Riga da aggiungere
...
...
...
...
Application.ScreenUpdating = True '<<<<<< Riga da aggiungere
Application.Calculation = xlCalculationAutomatic '<<<<<< Riga da aggiungere
End Sub '<<<<< fine macro
Torna a Applicazioni Office Windows
Macro che scatta quando cambia dato in un altro file Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 14 |
Excel: formula automatica per evidenziare prodotto scaduto Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 3 |
Salvare file excel in formato html escludendo le immagini Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 10 |
Modifica visualizzazione file di una cartella Autore: mastino46 |
Forum: Sistemi Operativi Windows Risposte: 2 |
Problema con macro copia e rinomina file Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 29 ospiti