Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hiding Shapes When Not WordArt , or When WordArt Text < "Draft"

Hello,

I have a spreadsheet that contains multiple sheets, and each sheet has
multiple shapes. Some of these shapes are WordArt, some textboxes,
arrows, etc. The shapes that are WordArt contain the text "Draft". I
have written VBA that cycles through each sheet, then each shape, to
hide them all. I don't however, want to hide the WordArt that contains
the text "Draft". I would like to be able to use an "IF/END IF"
paragragh to say, "IF not WordArt, then visible=false". Or else, I
would like to be able to say, "IF the shape does not contain the word
"Draft", then visible=false. I haven't been able to find a VBA
example using either technique. I have seen examples where you can
create WordArt, and add the proper text, but not using the text or the
type of shape to conditionally do something.

Thanks,

Carroll Rinehart
Social Security Administration
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Hiding Shapes When Not WordArt , or When WordArt Text < "Draft"

Maybe this'll help you:

Option Explicit
Sub testme()

Dim myShape As Shape
Dim myVisible As Boolean

For Each myShape In ActiveSheet.Shapes
myVisible = False
If myShape.Type = msoTextEffect Then
If InStr(1, myShape.TextEffect.Text, "draft", _
vbTextCompare) 0 Then
myVisible = True
End If
End If
myShape.Visible = myVisible
Next myShape

End Sub


Carroll Rinehart wrote:

Hello,

I have a spreadsheet that contains multiple sheets, and each sheet has
multiple shapes. Some of these shapes are WordArt, some textboxes,
arrows, etc. The shapes that are WordArt contain the text "Draft". I
have written VBA that cycles through each sheet, then each shape, to
hide them all. I don't however, want to hide the WordArt that contains
the text "Draft". I would like to be able to use an "IF/END IF"
paragragh to say, "IF not WordArt, then visible=false". Or else, I
would like to be able to say, "IF the shape does not contain the word
"Draft", then visible=false. I haven't been able to find a VBA
example using either technique. I have seen examples where you can
create WordArt, and add the proper text, but not using the text or the
type of shape to conditionally do something.

Thanks,

Carroll Rinehart
Social Security Administration


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hiding Shapes When Not WordArt , or When WordArt Text < "Draft"

Worked like a charm. Thanks for your suggestion, Dave.

Carroll Rinehart
Reply
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
WordArt Bojingles03 New Users to Excel 3 February 17th 09 06:09 PM
How do you Position WordArt behind data Kay Excel Worksheet Functions 0 July 30th 08 11:49 PM
WordArt - stretching aehdbe Excel Discussion (Misc queries) 0 March 28th 08 06:36 PM
Wordart in Excel D angel Excel Worksheet Functions 1 August 10th 06 06:46 PM
reference cell from wordart text box Brian P Bauer Excel Discussion (Misc queries) 0 June 21st 06 03:48 PM


All times are GMT +1. The time now is 02:12 AM.

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"