0

I don't understand where is the problem. I know about the recurring "too many cell formats" in VBA excel, but now I have the problem with a simple line of code:

If color <> -1 Then
 ActiveCell.Interior.color = Cell_Color
End If 

Where activecell is only a cell. Can you explain me why I got this problem ? How can I handle it without add-ins ?

1
  • what are your Cell_color and color variable values when you error occurs? Can you provide more of your code? Jul 8, 2013 at 15:38

1 Answer 1

0

I was quite surprised to have a "too many cell format" with only one cell because I tought excel was talking about the format of that cell. In fact this has nothing to do with the formats in the selection.

Its about a problem, only in excel 2003 where cells format are kept in memory, even unused ones. The number of cell format is also kept in a variable. Which is an integer and so is bounded to 65.000+. the problem appears when it is no more possible to increase the number of cell formats due to the integer limit.

Before this problems appears, a high number of cells formats can cause slowness of the macros. See the second answer here to clean unused cell format:

Too Many Different Cell Formats

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.