=============
=============
Vedi l'articolo:
Microsoft Knowledge Base Articolo # 213904:
'You receive a "Too many different cell formats" error message in Excel'
http://support.microsoft.com/default.aspx?scid=kb;en-us;213904
---
Regards.
Norman
Grazie per la segnalazione. Mi èstato utile e ho sbloccato il problema
azzerando la formattazione delle caselle bianche.
Vorrei un tuo parere. Se cancellassi intere pagine spostandole su altri
files potrei evitare il ripetersi del problema?
Mi spiego. Per 4000 formattazioni cosa si intende? La formattazione è intesa
per singola casella o per gruppo di celle?
Nel primo caso eliminando tante celle mi allontanerei da quel limite di 4000
formattazioni. Nel secondo caso invece la formattazione verrebbe sempre
conteggiata perchè caselle simili (da copia incolla originale delle pagine)
sono sempre presenti.
Grazie
============
Grazie per la segnalazione. Mi čstato utile e ho sbloccato il problema
azzerando la formattazione delle caselle bianche.
Vorrei un tuo parere. Se cancellassi intere pagine spostandole su altri
files potrei evitare il ripetersi del problema?
Mi spiego. Per 4000 formattazioni cosa si intende? La formattazione č intesa
per singola casella o per gruppo di celle?
Nel primo caso eliminando tante celle mi allontanerei da quel limite di 4000
formattazioni. Nel secondo caso invece la formattazione verrebbe sempre
conteggiata perchč caselle simili (da copia incolla originale delle pagine)
sono sempre presenti.
============
Ti rispondero' piu dettagliamente domani.
Tuttavia, ci sono spesso molti formati non
usati e per cancellare tali formati, potresti
utilizzare la seguente procedura sviluppata
da Leo Heuser.
In un modulo standard (vedi di sotto):
Prova la seguente routine:
'=============>>
Public Sub DeleteUnusedCustomNumberFormats()
'leo.heu...@get2net.dk, May 6. 2001
'Version 1.01
Dim Buffer As Object
Dim Sh As Object
Dim SaveFormat As Variant
Dim fFormat As Variant
Dim nFormat() As Variant
Dim xFormat As Long
Dim Counter As Long
Dim Counter1 As Long
Dim Counter2 As Long
Dim StartRow As Long
Dim EndRow As Long
Dim pPresent As Boolean
Dim NumberOfFormats As Long
Dim Answer
Dim Cell As Object
Dim DataStart As Long
Dim DataEnd As Long
Dim AnswerText As String
Dim ActWorkbookName As String
Dim BufferWorkbookName As String
NumberOfFormats = 1000
StartRow = 3 ' Do not alter this value
EndRow = Rows.Count
ReDim nFormat(0 To NumberOfFormats)
AnswerText = "Do you want to delete unused custom formats " _
& "from the workbook?"
AnswerText = AnswerText & Chr(10) & "To get a list of used " _
& "and unused formats only, choose No."
Answer = MsgBox(AnswerText, 259)
If Answer = vbCancel Then GoTo Finito
On Error GoTo Finito
ActWorkbookName = ActiveWorkbook.Name
Workbooks.Add
BufferWorkbookName = ActiveWorkbook.Name
Set Buffer = Workbooks(BufferWorkbookName). _
ActiveSheet.Range("A3")
nFormat(0) = Buffer.NumberFormatLocal
Buffer.NumberFormat = "@"
Buffer.Value = nFormat(0)
Workbooks(ActWorkbookName).Activate
Counter = 1
Do
SaveFormat = Buffer.Value
DoEvents
SendKeys "{TAB 3}"
For Counter1 = 1 To Counter
SendKeys "{DOWN}"
Next Counter1
SendKeys "+{TAB}{HOME}'{HOME}+{END}" _
& "^C{TAB 4}{ENTER}"
Application.Dialogs(xlDialogFormatNumber). _
Show nFormat(0)
ActiveSheet.Paste Destination:=Buffer
Buffer.Value = Mid(Buffer.Value, 2)
nFormat(Counter) = Buffer.Value
Counter = Counter + 1
Loop Until nFormat(Counter - 1) = SaveFormat
ReDim Preserve nFormat(0 To Counter - 2)
Workbooks(BufferWorkbookName).Activate
Range("A1").Value = "Custom formats"
Range("B1").Value = "Formats used in workbook"
Range("C1").Value = "Formats not used"
Range("A1:C1").Font.Bold = True
For Counter = 0 To UBound(nFormat)
Cells(StartRow, 1).Offset(Counter, 0). _
NumberFormatLocal = nFormat(Counter)
Cells(StartRow, 1).Offset(Counter, 0).Value = _
nFormat(Counter)
Next Counter
Counter = 0
For Each Sh In Workbooks(ActWorkbookName).Worksheets
For Each Cell In Sh.UsedRange.Cells
fFormat = Cell.NumberFormatLocal
If Application.WorksheetFunction.CountIf _
(Range(Cells(StartRow, 2), Cells _
(EndRow, 2)), fFormat) = 0 Then
Cells(StartRow, 2).Offset(Counter, 0). _
NumberFormatLocal = fFormat
Cells(StartRow, 2).Offset(Counter, 0).Value _
= fFormat
Counter = Counter + 1
End If
Next Cell
Next Sh
xFormat = Range(Cells(StartRow, 2), Cells(EndRow, 2)). _
Find("").Row - 2
Counter2 = 0
For Counter = 0 To UBound(nFormat)
pPresent = False
For Counter1 = 1 To xFormat
If nFormat(Counter) = Cells(StartRow, 2).Offset _
(Counter1, 0).NumberFormatLocal Then
pPresent = True
End If
Next Counter1
If pPresent = False Then
Cells(StartRow, 3).Offset(Counter2, 0). _
NumberFormatLocal = nFormat(Counter)
Cells(StartRow, 3).Offset(Counter2, 0).Value = _
nFormat(Counter)
Counter2 = Counter2 + 1
End If
Next Counter
With ActiveSheet.Columns("A:C")
.AutoFit
.HorizontalAlignment = xlLeft
End With
If Answer = vbYes Then
DataStart = Range(Cells(1, 3), _
Cells(EndRow, 3)).Find("").Row + 1
DataEnd = Cells(DataStart, 3).Resize(EndRow, 1). _
Find("").Row - 1
On Error Resume Next
For Each Cell In Range(Cells(DataStart, 3), _
Cells(DataEnd, 3)).Cells
Workbooks(ActWorkbookName).DeleteNumberFormat _
(Cell.NumberFormat)
Next Cell
End If
Finito:
Set Cell = Nothing
Set Sh = Nothing
Set Buffer = Nothing
End Sub
'<<=============
Per utilizzare questa macro:
Alt-F11 per aprire l'Editor di VBA
Menu | Inserisci | Modulo
Incollarci il suddeto codice
Alt-F11 per tornare in Excel
Alt -F8
Seleziona "DeleteUnusedCustomNumberFormats"
esegui
Quando esegui la macro, rispondi in affermativo al
primo messaggio.
---
Regards.
Norman
=============
Ti rispondero' piu dettagliamente domani.
=============
No! Non posso lasciarti cosi!
Hai chiesto:
=============
Per 4000 formattazioni cosa si intende? La formattazione č intesa
per singola casella o per gruppo di celle?
=============
L'articolo segnalato da me:
Microsoft Knowledge Base Articolo # 213904:
'You receive a "Too many different cell formats" error message in Excel'
http://support.microsoft.com/default.aspx?scid=kb;en-us;213904
risponde esplicitamente a questo punto:
============>>
This problem occurs when the workbook contains more than approximately 4,000
different combinations of cell formats. A combination is defined as a unique
set of formatting elements that are applied to a cell. A combination
includes all font formatting (for example: typeface, font size, italic,
bold, and underline), borders (for example: location, weight, and color),
cell patterns, number formatting, alignment, and cell protection.
NOTE: If two or more cells share exactly the same formatting, they use one
formatting combination. However, if there are any differences in formatting
between the cells, each cell uses a different combination.
<<============
Se questo non ti e' chiaro perche' sia in inglese,
potrei tentare una traduzione io, ma per FWIW,
la traduzione automatica offerta da Microsoft dice:
============>>
Questo problema si verifica se la cartella di lavoro contiene piů circa di
4000 combinazioni diverse di formati di celle. Una combinazione č definita
come un insieme univoco di formattare gli elementi applicati a una cella. Ad
esempio, ad esempio, una combinazione comprende tutta la formattazione di
carattere ( : il carattere tipografico, la dimensione di carattere, il
corsivo grassetto e la sottolineatura ) , i bordi ( : la posizione, il peso
e il colore ) la cella dei motivi, numera la formattazione, l'allineamento e
la protezione di cella.
NOTA: Se due o piů celle condividono esattamente la stessa formattazione,
esse utilizzano una combinazione di formattazione. Se esistono le eventuali
differenze nella formattazione tra le celle, ogni cella tuttavia utilizza
una combinazione diverse.
<<============
---
Regards.
Norman
Ma siete così gentili per passione o alla fine mi arriva la fattura a casa?
:)
Grazie del chiarimento.
Il documento su cui ho avuto il problema è in continua evoluzione e si
ingrandisce giorno per giorno con nuove formattazioni. Quindi ho deciso di
spezzarlo in documenti diversi.
Tento comunque in parallelo la soluzione che mi hai proposto nel precedente
post visto che sono un semplice autodidatta ma mi piace imparare cose nuove
di excel.
Grazie ancora della vostra gentilezza... ma poi non lamentatevi se tornerò
(spesso) a chiedere il vostro aiuto.
Costante