Ciao a tutti,
in una tabella pivot vorrei (ma non ci riesco...) riempire le righe vuote in colore giallo.
La tabella comprende le colonne A:F e si sviluppa su alcune centinaia di righe (di numero variabile)
Potete aiutarmi?
Grazie
Moderatori: Anthony47, Flash30005
Sub PvTYell()
Dim iRow As Long, eRow As Long, iCol As Long, eCol As Long
'
With ActiveSheet.PivotTables(1).TableRange1 '<<< Adatta l'Index, se hai piu' pivot sul foglio
iRow = .Cells(1).Row
eRow = .Cells(.Cells.Count).Row
iCol = .Cells(1).Column
eCol = .Cells(.Cells.Count).Column
End With
Range(Cells(iRow, iCol), Cells(eRow, eCol)).Interior.Color = xlNone
For i = iRow To eRow
If Application.WorksheetFunction.CountBlank(Cells(i, iCol + 1).Resize(1, eCol - iCol)) = (eCol - iCol) Then
Cells(i, iCol + 1).Resize(1, eCol - iCol).Interior.Color = RGB(255, 255, 0)
End If
Next i
End Sub
Temo che almeno Application.WorksheetFunction.CountBlank non funzionerà (CONTA.VUOTE esiste dalla versione 2007)
If Application.WorksheetFunction.CountA(Cells(i, iCol + 1).Resize(1, eCol - iCol)) = 0 Then
Sub PvTYell2()
Dim iRow As Long, eRow As Long, iCol As Long, eCol As Long
'
With ActiveSheet.PivotTables(1).TableRange1 '<<< Adatta l'Index, se hai piu' pivot sul foglio
iRow = .Cells(1).Row
eRow = .Cells(.Cells.Count).Row
iCol = .Cells(1).Column
If Cells(iRow, iCol) = "" Then 'Aggiunte, da qui
iRow = Cells(iRow, iCol).End(xlDown).Row
End If
eCol = Cells(iRow, iCol).End(xlToRight).Column
' eCol = .Cells(.Cells.Count).Column 'Eliminata
End With
Range(Cells(iRow, iCol), Cells(eRow, eCol)).Interior.Color = xlNone
For i = iRow To eRow
If Application.WorksheetFunction.CountA(Cells(i, iCol + 1).Resize(1, eCol - iCol)) = 0 Then
Cells(i, iCol + 0).Resize(1, eCol - iCol + 1).Interior.Color = RGB(255, 255, 0) 'Modificata
End If
Next i
End Sub
Range(Cells(iRow, iCol), Cells(eRow, eCol)).Interior.Color = RGB(255, 255, 255)Torna a Applicazioni Office Windows
| Excel apre solo una schermata bianca Autore: jameswilson |
Forum: Applicazioni Office Windows Risposte: 1 |
| 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: 7 |
Visitano il forum: Nessuno e 12 ospiti