Moderatori: Anthony47, Flash30005
' Parte di pulizia dei fogli clienti
For h = 15 To Sheets.Count
Sheets(h).Select
ir = 2
For x = 1 To 200
If Cells(ir, 7) = Empty Then
Cells(ir, 7).EntireRow.Delete
ir = ir - 1
End If
ir = ir + 1
x = x + 1
Next
Next
Sub UNICA()
'
Dim I As Long
'
' Parte di pulizia del Generale
Sheets("Generale").Select
ActiveSheet.Unprotect
ir = 2
For x = 1 To 1600
If Cells(ir, 1) = Empty Then
Cells(ir, 1).EntireRow.Delete
ir = ir - 1
End If
ir = ir + 1
x = x + 1
Next
' Parte di ordinamento funzionante
Rows("2:200").Select
ActiveWorkbook.Worksheets("Generale").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Generale").Sort.SortFields.Add Key:=Range("G3:G214"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Generale").Sort
.SetRange Range("A2:O214")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
' Parte funzionante
UR = Worksheets("Generale").Range("G" & Rows.Count).End(xlUp).Row '<<<< CONTEGGIO RIGHE PIENE
For ir = 3 To UR
If Cells(ir, 7) <> Cells(ir - 1, 7) Then
Sheets("COMMITTENTE").Copy After:=Worksheets(Worksheets.Count) '<<<RIGA MODIFICATA
ActiveSheet.Name = Worksheets("Generale").Range("G" & ir).Value '<<<RIGA FONDAMENTALE
ActiveSheet.Range("A" & ir, "N" & ir).Value = Worksheets("Generale").Range("A" & ir, "N" & ir).Value
ActiveSheet.Range("O" & ir).Value = Worksheets("Generale").Range("P" & ir).Value
Sheets("Generale").Select
End If
If Cells(ir, 7) = Cells(ir - 1, 7) Then
Sheets(Worksheets("Generale").Range("G" & ir).Value).Select
ActiveSheet.Range("A" & ir, "N" & ir).Value = Worksheets("Generale").Range("A" & ir, "N" & ir).Value
ActiveSheet.Range("O" & ir).Value = Worksheets("Generale").Range("P" & ir).Value
Sheets("Generale").Select
End If
Next
' Parte di pulizia dei fogli clienti
For h = 15 To Sheets.Count
Sheets(h).Select '<<< PROBLEMA QUI
ir = 2
For x = 1 To 200
If Cells(ir, 7) = Empty Then
Cells(ir, 7).EntireRow.Delete
ir = ir - 1
End If
ir = ir + 1
x = x + 1
Next
Next
Sheets("COMMITTENTE").Select
ActiveWindow.SelectedSheets.Visible = False
End Sub
Sub CancellaRighe()
For h = 1 To Sheets.Count
UR2 = Sheets(h).Range("G" & Rows.Count).End(xlUp).Row
Worksheets(h).Select
Range("G1").Select
Range("A1:H263").Sort Key1:=Range("G2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
URC = Sheets(h).Range("G" & Rows.Count).End(xlUp).Row
Rows(URC + 1 & ":" & UR2).Select
Selection.ClearContents
Selection.Delete Shift:=xlUp
Next
End Sub
UR2 = Sheets(h).Range("G" & Rows.Count).End(xlUp).Row '<<< Esistente
NomeF = Worksheets(h).Name '<<< Aggiunta
Worksheets(NomeF).Select '<<< Modificata
Range("G1").Select '<<< Esistente
For h = 15 To Sheets.Count
Sheets(h).Select
ir = 2
For x = 1 To 200
If Cells(ir, 7) = Empty Then
Cells(ir, 7).EntireRow.Delete
ir = ir - 1
End If
ir = ir + 1
x = x + 1
Next
Next
Torna a Applicazioni Office Windows
Come evidenziare aree separate di un foglio Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 18 |
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 |
Visitano il forum: Nessuno e 34 ospiti