LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Bug in VBA code to count colors/shapes

Thanks Dave. I'll implement this. The help is appreciated!

Scott


"Dave Peterson" wrote in message
...
InStr will look anywhere in that string.

cboCountColors
optCxxxcboyyy

You may just want to check the first three characters:

if lcase(left(shp.name)) = "cbo" then
---
end if



Nimrod wrote:

Sorry to the group for double-posting. In any regard, I found what I
needed:

For Each shp in ActiveSheet.Shapes
If InStr(1, shp.Name, "cbo") = 0 Then
---
End if

I use the "If InStr" line in place of the < "cboCountColors" and I seem
to
achieve the same. This also may be a better approach than providing
testing
for the several buttons I use.

Again, great thanks for the help.

Scott

"Nimrod" wrote in message
...
Thanks again for your help Tom. I have another question. I have
several
buttons I choose to use to change a rectangle to various colors. All
of
my
buttons begin with "cbo" (something I picked up along the way). I have
been
trying to figure out how to use InStr (x,y) to skip shapes beginning
with
"cbo" but I can't get the syntax right. Any ideas? I was figuring on
"If
Instr(whatever) 0 Then ... end if"


--

Dave Peterson



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel document with shapes on it but the shapes do not print [email protected] Excel Worksheet Functions 2 October 22nd 09 06:17 PM
Used drawing colors in shapes....lost default colors for "Fill Col Lai704 Excel Discussion (Misc queries) 1 August 20th 08 04:45 AM
How do I save pivotchart colors and shapes on data refresh? ReggieSLC Charts and Charting in Excel 0 April 16th 08 10:26 PM
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
How can I loop to find the grouped shapes count David Cuthill Excel Programming 3 January 26th 04 08:22 PM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"