View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Scott B Scott B is offline
external usenet poster
 
Posts: 3
Default VBA code to count colors/shapes?

Bob,

I have tried the code on both Excel with Office XP and again with Excel 2003
and it's not working with either. Any help with a work around would be
appreciated.

One more question. Is there a good book you can recommend that covers
VB/VBA for Excel which covers things like this? Again, thanks for your
help.

Best Regards,
Scott


"Bob Phillips" wrote in message
...
What Excel version?

I tested this VBA code and I get a Permission Denied error. The VBA

editor
highlights "Select Case shp.fill....." Though I am associating this code
with a command button:

Private Sub CommandButton1_Click()

Dim shp As Shape
Dim nRed As Long
Dim nBlue As Long

For Each shp In ActiveSheet.Shapes
Select Case shp.Fill.ForeColor.SchemeColor
....snip

What did I do wrong? Thanks again in advance. I will continue to play
around with this code.