Excel VBA質問箱 IV

当質問箱は、有志のボランティア精神のおかげで成り立っています。
問題が解決したら、必ずお礼をしましょうね。
本サイトの基本方針をまとめました。こちら をご一読ください。

投稿種別の選択が必要です。ご注意ください。
迷惑投稿防止のため、URLの入力を制限しています。ご了承ください。


11312 / 76735 ←次へ | 前へ→

【70961】Re:オートシェイプの種類識別
発言  kanabun  - 12/1/21(土) 10:57 -

引用なし
パスワード
   Sub Try1()
 Dim shp As Shape
 Dim i&
 For Each shp In Worksheets(1).Shapes
   i = i + 1
   With Worksheets(2).Cells(i, 1)
     .Value = shp.Name
     .Offset(, 1).Value = shp.Type
     .Offset(, 2).Value = AutoType(shp) '下の関数を呼び出す
   End With
 Next
End Sub

'// ヘルプの一覧をコードにしただけのものですが...
Function AutoType(shp As Shape) As String
 Dim ss As String
 Select Case shp.AutoShapeType
  Case msoShape24pointStar: ss = "msoShape24pointStar "
  Case msoShape4pointStar: ss = "msoShape4pointStar "
  Case msoShape8pointStar: ss = "msoShape8pointStar "
  Case msoShapeActionButtonBeginning: ss = "msoShapeActionButtonBeginning "
  Case msoShapeActionButtonDocument: ss = "msoShapeActionButtonDocument "
  Case msoShapeActionButtonForwardorNext: ss = "msoShapeActionButtonForwardorNext "
  Case msoShapeActionButtonHome: ss = "msoShapeActionButtonHome "
  Case msoShapeActionButtonMovie: ss = "msoShapeActionButtonMovie "
  Case msoShapeActionButtonSound: ss = "msoShapeActionButtonSound "
  Case msoShapeBalloon: ss = "msoShapeBalloon "
  Case msoShapeBentUpArrow: ss = "msoShapeBentUpArrow "
  Case msoShapeBlockArc: ss = "msoShapeBlockArc "
  Case msoShapeChevron: ss = "msoShapeChevron "
  Case msoShapeCloudCallout: ss = "msoShapeCloudCallout "
  Case msoShapeCube: ss = "msoShapeCube "
  Case msoShapeCurvedDownRibbon: ss = "msoShapeCurvedDownRibbon "
  Case msoShapeCurvedRightArrow: ss = "msoShapeCurvedRightArrow "
  Case msoShapeCurvedUpRibbon: ss = "msoShapeCurvedUpRibbon "
  Case msoShapeDonut: ss = "msoShapeDonut "
  Case msoShapeDoubleBracket: ss = "msoShapeDoubleBracket "
  Case msoShapeDownArrow: ss = "msoShapeDownArrow "
  Case msoShapeDownRibbon: ss = "msoShapeDownRibbon "
  Case msoShapeExplosion2: ss = "msoShapeExplosion2 "
  Case msoShapeFlowchartCard: ss = "msoShapeFlowchartCard "
  Case msoShapeFlowchartConnector: ss = "msoShapeFlowchartConnector "
  Case msoShapeFlowchartDecision: ss = "msoShapeFlowchartDecision "
  Case msoShapeFlowchartDirectAccessStorage: ss = "msoShapeFlowchartDirectAccessStorage "
  Case msoShapeFlowchartDisplay: ss = "msoShapeFlowchartDisplay "
  Case msoShapeFlowchartDocument: ss = "msoShapeFlowchartDocument "
  Case msoShapeFlowchartExtract: ss = "msoShapeFlowchartExtract "
  Case msoShapeFlowchartInternalStorage: ss = "msoShapeFlowchartInternalStorage "
  Case msoShapeFlowchartMagneticDisk: ss = "msoShapeFlowchartMagneticDisk "
  Case msoShapeFlowchartManualInput: ss = "msoShapeFlowchartManualInput "
  Case msoShapeFlowchartManualOperation: ss = "msoShapeFlowchartManualOperation "
  Case msoShapeFlowchartMerge: ss = "msoShapeFlowchartMerge "
  Case msoShapeFlowchartMultidocument: ss = "msoShapeFlowchartMultidocument "
  Case msoShapeFlowchartOffpageConnector: ss = "msoShapeFlowchartOffpageConnector "
  Case msoShapeFlowchartOr: ss = "msoShapeFlowchartOr "
  Case msoShapeFlowchartPredefinedProcess: ss = "msoShapeFlowchartPredefinedProcess "
  Case msoShapeFlowchartPreparation: ss = "msoShapeFlowchartPreparation "
  Case msoShapeFlowchartProcess: ss = "msoShapeFlowchartProcess "
  Case msoShapeFlowchartPunchedTape: ss = "msoShapeFlowchartPunchedTape "
  Case msoShapeFlowchartSequentialAccessStorage: ss = "msoShapeFlowchartSequentialAccessStorage "
  Case msoShapeFlowchartSort: ss = "msoShapeFlowchartSort "
  Case msoShapeFlowchartStoredData: ss = "msoShapeFlowchartStoredData "
  Case msoShapeFlowchartSummingJunction: ss = "msoShapeFlowchartSummingJunction "
  Case msoShapeFlowchartTerminator: ss = "msoShapeFlowchartTerminator "
  Case msoShapeFoldedCorner: ss = "msoShapeFoldedCorner "
  Case msoShapeHeart: ss = "msoShapeHeart "
  Case msoShapeHexagon: ss = "msoShapeHexagon "
  Case msoShapeHorizontalScroll: ss = "msoShapeHorizontalScroll "
  Case msoShapeIsoscelesTriangle: ss = "msoShapeIsoscelesTriangle "
  Case msoShapeLeftArrow: ss = "msoShapeLeftArrow "
  Case msoShapeLeftArrowCallout: ss = "msoShapeLeftArrowCallout "
  Case msoShapeLeftBrace: ss = "msoShapeLeftBrace "
  Case msoShapeLeftBracket: ss = "msoShapeLeftBracket "
  Case msoShapeLeftRightArrow: ss = "msoShapeLeftRightArrow "
  Case msoShapeLeftRightArrowCallout: ss = "msoShapeLeftRightArrowCallout "
  Case msoShapeLeftRightUpArrow: ss = "msoShapeLeftRightUpArrow "
  Case msoShapeLeftUpArrow: ss = "msoShapeLeftUpArrow "
  Case msoShapeLightningBolt: ss = "msoShapeLightningBolt "
  Case msoShapeLineCallout1: ss = "msoShapeLineCallout1 "
  Case msoShapeLineCallout1AccentBar: ss = "msoShapeLineCallout1AccentBar "
  Case msoShapeLineCallout1BorderandAccentBar: ss = "msoShapeLineCallout1BorderandAccentBar "
  Case msoShapeLineCallout1NoBorder: ss = "msoShapeLineCallout1NoBorder "
  Case msoShapeLineCallout2: ss = "msoShapeLineCallout2 "
  Case msoShapeLineCallout2AccentBar: ss = "msoShapeLineCallout2AccentBar "
  Case msoShapeLineCallout2BorderandAccentBar: ss = "msoShapeLineCallout2BorderandAccentBar "
  Case msoShapeLineCallout2NoBorder: ss = "msoShapeLineCallout2NoBorder "
  Case msoShapeLineCallout3: ss = "msoShapeLineCallout3 "
  Case msoShapeLineCallout3AccentBar: ss = "msoShapeLineCallout3AccentBar "
  Case msoShapeLineCallout3BorderandAccentBar: ss = "msoShapeLineCallout3BorderandAccentBar "
  Case msoShapeLineCallout3NoBorder: ss = "msoShapeLineCallout3NoBorder "
  Case msoShapeLineCallout4: ss = "msoShapeLineCallout4 "
  Case msoShapeLineCallout4AccentBar: ss = "msoShapeLineCallout4AccentBar "
  Case msoShapeLineCallout4BorderandAccentBar: ss = "msoShapeLineCallout4BorderandAccentBar "
  Case msoShapeLineCallout4NoBorder: ss = "msoShapeLineCallout4NoBorder "
  Case msoShapeMixed: ss = "msoShapeMixed "
  Case msoShapeMoon: ss = "msoShapeMoon "
  Case msoShapeNoSymbol: ss = "msoShapeNoSymbol "
  Case msoShapeNotchedRightArrow: ss = "msoShapeNotchedRightArrow "
  Case msoShapeNotPrimitive: ss = "msoShapeNotPrimitive "
  Case msoShapeOctagon: ss = "msoShapeOctagon "
  Case msoShapeOval: ss = "msoShapeOval "
  Case msoShapeOvalCallout: ss = "msoShapeOvalCallout "
  Case msoShapeParallelogram: ss = "msoShapeParallelogram "
  Case msoShapePentagon: ss = "msoShapePentagon "
  Case msoShapePlaque: ss = "msoShapePlaque "
  Case msoShapeQuadArrowCallout: ss = "msoShapeQuadArrowCallout "
  Case msoShapeRectangularCallout: ss = "msoShapeRectangularCallout "
  Case msoShapeRightArrow: ss = "msoShapeRightArrow "
  Case msoShapeRightBrace: ss = "msoShapeRightBrace "
  Case msoShapeRightTriangle: ss = "msoShapeRightTriangle "
  Case msoShapeRoundedRectangularCallout: ss = "msoShapeRoundedRectangularCallout "
  Case msoShapeStripedRightArrow: ss = "msoShapeStripedRightArrow "
  Case msoShapeTrapezoid: ss = "msoShapeTrapezoid "
  Case msoShapeUpArrowCallout: ss = "msoShapeUpArrowCallout "
  Case msoShapeUpDownArrowCallout: ss = "msoShapeUpDownArrowCallout "
  Case msoShapeUTurnArrow: ss = "msoShapeUTurnArrow "
  Case msoShapeWave: ss = "msoShapeWave "
  Case msoShape16pointStar: ss = "msoShape16pointStar "
  Case msoShape32pointStar: ss = "msoShape32pointStar "
  Case msoShape5pointStar: ss = "msoShape5pointStar "
  Case msoShapeActionButtonBackorPrevious: ss = "msoShapeActionButtonBackorPrevious "
  Case msoShapeActionButtonCustom: ss = "msoShapeActionButtonCustom "
  Case msoShapeActionButtonEnd: ss = "msoShapeActionButtonEnd "
  Case msoShapeActionButtonHelp: ss = "msoShapeActionButtonHelp "
  Case msoShapeActionButtonInformation: ss = "msoShapeActionButtonInformation "
  Case msoShapeActionButtonReturn: ss = "msoShapeActionButtonReturn "
  Case msoShapeArc: ss = "msoShapeArc "
  Case msoShapeBentArrow: ss = "msoShapeBentArrow "
  Case msoShapeBevel: ss = "msoShapeBevel "
  Case msoShapeCan: ss = "msoShapeCan "
  Case msoShapeCircularArrow: ss = "msoShapeCircularArrow "
  Case msoShapeCross: ss = "msoShapeCross "
  Case msoShapeCurvedDownArrow: ss = "msoShapeCurvedDownArrow "
  Case msoShapeCurvedLeftArrow: ss = "msoShapeCurvedLeftArrow "
  Case msoShapeCurvedUpArrow: ss = "msoShapeCurvedUpArrow "
  Case msoShapeDiamond: ss = "msoShapeDiamond "
  Case msoShapeDoubleBrace: ss = "msoShapeDoubleBrace "
  Case msoShapeDoubleWave: ss = "msoShapeDoubleWave "
  Case msoShapeDownArrowCallout: ss = "msoShapeDownArrowCallout "
  Case msoShapeExplosion1: ss = "msoShapeExplosion1 "
  Case msoShapeFlowchartAlternateProcess: ss = "msoShapeFlowchartAlternateProcess "
  Case msoShapeFlowchartCollate: ss = "msoShapeFlowchartCollate "
  Case msoShapeFlowchartData: ss = "msoShapeFlowchartData "
  Case msoShapeFlowchartDelay: ss = "msoShapeFlowchartDelay "
  Case msoShapeQuadArrow: ss = "msoShapeQuadArrow "
  Case msoShapeRectangle: ss = "msoShapeRectangle "
  Case msoShapeRegularPentagon: ss = "msoShapeRegularPentagon "
  Case msoShapeRightArrowCallout: ss = "msoShapeRightArrowCallout "
  Case msoShapeRightBracket: ss = "msoShapeRightBracket "
  Case msoShapeRoundedRectangle: ss = "msoShapeRoundedRectangle "
  Case msoShapeSmileyFace: ss = "msoShapeSmileyFace "
  Case msoShapeSun: ss = "msoShapeSun "
  Case msoShapeUpArrow: ss = "msoShapeUpArrow "
  Case msoShapeUpDownArrow: ss = "msoShapeUpDownArrow "
  Case msoShapeUpRibbon: ss = "msoShapeUpRibbon "
  Case msoShapeVerticalScroll: ss = "msoShapeVerticalScroll "
 End Select
 AutoType = ss

End Function

6 hits

【70955】オートシェイプの種類識別 saya 12/1/20(金) 23:09 質問
【70960】Re:オートシェイプの種類識別 kanabun 12/1/21(土) 10:39 発言
【70961】Re:オートシェイプの種類識別 kanabun 12/1/21(土) 10:57 発言
【70967】Re:オートシェイプの種類識別 saya 12/1/21(土) 21:59 質問
【70968】Re:オートシェイプの種類識別 kanabun 12/1/21(土) 22:35 発言
【70983】Re:オートシェイプの種類識別 saya 12/1/23(月) 22:53 お礼

11312 / 76735 ←次へ | 前へ→
ページ:  ┃  記事番号:
2610219
(SS)C-BOARD v3.8 is Free