Intanto io ci provo......
Grazie ancora per la disponibilità
Moderatori: Anthony47, Flash30005
Sub ConfrontaEColora()
Set Ws1 = Worksheets("Foglio1") 'Elenco Utenti Infrataras
Set Ws2 = Worksheets("Foglio2") 'Elenco Utenti Enel gas
Set Ws3 = Worksheets("Foglio3") 'Utenti che non sono più nel Elenco Utenti Enel gas
Set Ws4 = Worksheets("Foglio4") 'Nuovi Utenti (non erano nel Elenco Utenti Infrataras)
Application.ScreenUpdating = False
Application.Calculation = xlManual
Ws3.Cells.Clear
Ws4.Cells.Clear
Ws1.Cells.Copy Destination:=Ws3.Cells
Ws2.Cells.Copy Destination:=Ws4.Cells
URS = Ws1.Range("A" & Rows.Count).End(xlUp).Row '<<<< alias Foglio3
UCS = Ws1.Range("IV1").End(xlToLeft).Column
Ws3.Select
Ws3.Range(Cells(2, 1), Cells(URS, UCS)).Interior.ColorIndex = 4
URA = Ws2.Range("A" & Rows.Count).End(xlUp).Row '<<< alias Foglio4
Set Ws4 = Ws4
Ws4.Select
UCA = Ws2.Range("IV1").End(xlToLeft).Column
Ws4.Range(Ws4.Cells(2, 1), Ws4.Cells(URA, UCA)).Interior.ColorIndex = 6
For RS = 2 To URS
StrRS = ""
UCA = Ws1.Range("IV" & RS).End(xlToLeft).Column
For CS = 1 To UCA
StrRS = StrRS & Ws1.Cells(RS, CS).Value
Next CS
For RA = 2 To URA
StrRA = ""
For CS = 1 To UCA
StrRA = StrRA & Ws4.Cells(RA, CS).Value
Next CS
If StrRS = StrRA Then
Ws4.Range(Ws4.Cells(RA, 1), Ws4.Cells(RA, 30)).Interior.ColorIndex = 0
GoTo SaltaRS
Else
For CS = 1 To UCA
If Ws1.Cells(RS, CS).Value = Ws4.Cells(RA, CS).Value Then Ws4.Cells(RA, CS).Interior.ColorIndex = 0
Next CS
End If
Next RA
SaltaRS:
Next RS
For RA = 2 To URA
StrRA = ""
UCA = Ws2.Range("IV" & RA).End(xlToLeft).Column
For CS = 1 To UCA
StrRA = StrRA & Ws2.Cells(RA, CS).Value
Next CS
For RS = 2 To URS
StrRS = ""
For CS = 1 To UCA
StrRS = StrRS & Ws3.Cells(RS, CS).Value
Next CS
If StrRS = StrRA Then
Ws3.Range(Ws3.Cells(RS, 1), Ws3.Cells(RS, 30)).Interior.ColorIndex = 0
GoTo SaltaRA
Else
For CS = 1 To UCA
If Ws2.Cells(RA, CS).Value = Ws3.Cells(RS, CS).Value Then Ws3.Cells(RS, CS).Interior.ColorIndex = 0
Next CS
End If
Next RS
SaltaRA:
Next RA
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End SubTorna a Applicazioni Office Windows
| Excel apre solo una schermata bianca Autore: jameswilson |
Forum: Applicazioni Office Windows Risposte: 1 |
| programma convertitore e taglia file video e audio Autore: gianscooby |
Forum: Audio/Video e masterizzazione Risposte: 3 |
Visitano il forum: Nessuno e 32 ospiti