Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worked like a charm. Thanks for your suggestion, Dave.
Carroll Rinehart |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
WordArt | New Users to Excel | |||
How do you Position WordArt behind data | Excel Worksheet Functions | |||
WordArt - stretching | Excel Discussion (Misc queries) | |||
Wordart in Excel | Excel Worksheet Functions | |||
reference cell from wordart text box | Excel Discussion (Misc queries) |