Moderatori: Anthony47, Flash30005
Sub max20()
Dim DAmatr, Amatr
DAmatr = Array(13, 14, 15, 16) 'tutti i numeri da sostituire
Amatrr = Array(111, 222, 333, 444) 'tutti i sostituti
For I = LBound(DAmatr, 1) To UBound(DAmatr, 1)
For J = 1 To ThisWorkbook.Worksheets.Count
Sheets(J).Cells.Replace What:=DAmatr(I), Replacement:=Amatrr(I), LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next J
Next I
End Sub
Sub SostM()
For J = 1 To ThisWorkbook.Worksheets.Count
For I = 13 To 37
For RR = 2 To 38
For CC = 2 To 38
S = (I Mod 12) * 111
If S = 0 Then S = 12 * 111 '<<<< eliminare questa riga se con 12 e 24 si vuole ottenere zero
If Cells(RR, CC).Value = I Then Cells(RR, CC).Value = S
Next CC
Next RR
Next I
Next J
End Sub
Sub SostM()
For J = 1 To ThisWorkbook.Worksheets.Count
For I = 13 To 37
For RR = 2 To 38
For CC = 2 To 38
S = I Mod 12
If S = 0 Then S = 12
If Cells(RR, CC).Value = I Then Cells(RR, CC).Value = S
Next CC
Next RR
Next I
Next J
End Sub
Sheets(J).UsedRange.Offset(1, 1).Replace What:=DAmatr(I), Replacement:=Amatrr(I), LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
max2011 ha scritto:Mi servirebbe che lavorasse su più fogli.
Sub SostM()
Application.Calculation = xlManual
For J = 1 To ThisWorkbook.Worksheets.Count '<<<<< aggiunta riga per velocizzare (ferma il calcolo automatico)
For I = 13 To 37
For RR = 2 To 38
For CC = 2 To 38
S = I Mod 12
If S = 0 Then S = 12
If Sheets(J).Cells(RR, CC).Value = I Then Sheets(J).Cells(RR, CC).Value = S '<<<< modificare questa
Next CC
Next RR
Next I
Next J
Application.Calculation = xlCalculationAutomatic '<<<<< aggiunta riga per ripristino calcolo automatico
End Sub
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 42 ospiti