quindi la 15 del foglio1 deve rimanere !
E per l'altra cosa mi dici?
Puoi riprovare con un file nuovo senza nessuna cancellazione fatta dalla macro?
Prova con quello che hai inviato al forum: scaricalo dal forum.
Moderatori: Anthony47, Flash30005
Sub DelDup()
Dim I As Integer, J As Integer, KCnt As Long
Dim ICol As Integer, myKey As String
Dim WsInd
'
ICol = 45 'useremo col AS di Sheets("1"=)
'
Set WsInd = ThisWorkbook.Sheets("1")
KCnt = 1
WsInd.Columns(ICol).ClearContents
For I = 1 To ThisWorkbook.Worksheets.Count
For J = 2 To 38
myKey = MakeK(I, J)
If Application.WorksheetFunction.CountIf(WsInd.Cells(1, ICol).Resize(KCnt, 1), myKey) = 0 Then
WsInd.Cells(KCnt, ICol) = myKey
KCnt = KCnt + 1
Else
Sheets(I).Columns(J).ClearContents
End If
Next J
Next I
WsInd.Columns(ICol).ClearContents
WsInd.UsedRange
End Sub
Function MakeK(ByVal SInd, ByVal CCol) As String
Dim I As Integer
myK = "A"
For I = 2 To 38
myK = myK & Format(Sheets(SInd).Cells(I, CCol).Value, "00")
Next I
MakeK = myK
End Function
Debug.Print "Sheets: " & I
Debug.Print "Column: " & J
Sub DelDup()
Dim I As Integer, J As Integer, KCnt As Long
Dim ICol As Integer, myKey As String
Dim WsInd
'
ICol = 45 'useremo col AS di Sheets("1"=)
'
Set WsInd = ThisWorkbook.Sheets("1")
KCnt = 1
WsInd.Columns(ICol).ClearContents
For I = 1 To ThisWorkbook.Worksheets.Count
For J = 2 To 38
myKey = MakeK(I, J)
If Application.WorksheetFunction.CountIf(WsInd.Cells(1, ICol).Resize(KCnt, 1), myKey) = 0 Then
WsInd.Cells(KCnt, ICol) = myKey
KCnt = KCnt + 1
Else
Sheets(I).Columns(J).ClearContents
End If
Next J
Next I
WsInd.Columns(ICol).ClearContents
WsInd.UsedRange
End Sub
Function MakeK(ByVal SInd, ByVal CCol) As String
Dim I As Integer
myK = "A"
For I = 2 To 38
myK = myK & Format(Sheets(SInd).Cells(I, CCol).Value, "00")
Next I
MakeK = myK
End Function
Torna a Applicazioni Office Windows
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: 5 |
formula excel non visualizza risultato Autore: tommasog |
Forum: Applicazioni Office Windows Risposte: 6 |
Funzione CERCA ma con colonne dinamiche Autore: Paolo67met |
Forum: Applicazioni Office Windows Risposte: 2 |
Excel 2016 - Funzione SCARTO + INDIRETTO Autore: pl1957 |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 119 ospiti