目安箱 IV

目安箱投稿のルールはこちらをごらんください。
ご意見は電子メールで承っています。
「目安箱」は質問禁止です。技術的な質問はそれぞれの質問箱へどうぞ。

迷惑投稿防止のため、URLの入力を制限しています。ご了承ください。

  新規投稿 ┃ツリー表示 ┃一覧表示 ┃トピック表示 ┃検索 ┃設定 ┃ホーム  
107 / 107 ツリー ←次へ

【4】アドインファイルにてツールバーを表示するには、[ソフト紹介] ぴかる 02/9/2(月) 20:42 Excel[未読]

【13】メニューバー ぴかる 02/9/2(月) 21:19 Excel[未読]
【14】つづき ぴかる 02/9/2(月) 21:20 Excel[未読]

【13】メニューバー
Excel  ぴかる  - 02/9/2(月) 21:19 -

引用なし
パスワード
   Sub オリジナルメニューバー作成()

Dim myCB As CommandBar
Dim myCBCtrl As CommandBarControl
Dim myCBBtn As CommandBarButton
Dim myCBpup As CommandBarPopup

  On Error Resume Next
  Application.CommandBars("PikaBar").Delete
  On Error GoTo 0
  Set myCB = Application.CommandBars.Add(Name:="PikaBar", Position:=msoBarTop, MenuBar:=True)
  
  With Application.CommandBars(1)
    For II% = 1 To 9
      Select Case II%
        Case 7:  IdNum& = 30011
        Case Else: IdNum& = 30000 + II% + 1
      End Select
      Set myCBCtrl = .FindControl(ID:=IdNum&): myCBCtrl.Copy myCB, II%
    Next
  End With
  
  Set myCBCtrl = myCB.Controls.Add(Type:=msoControlPopup)
  With myCBCtrl
    .Caption = "セル書式"
    .BeginGroup = True
    .OnAction = "列Caption"
  End With
    
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "表示形式"
     .OnAction = "表示形式"
   End With
   
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "配置"
     .OnAction = "配置"
   End With
   
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "フォント"
     .OnAction = "フォント"
   End With
   
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "罫線"
     .OnAction = "罫線"
   End With
   
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "パターン"
     .OnAction = "パターン"
   End With
   
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "保護"
     .OnAction = "保護"
   End With
   
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(ID:=3058)
   myCBCtrl.BeginGroup = True
   
   Set myCBCtrl = myCB.Controls("セル書式").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "列形式A1…R1C1"
     .OnAction = "列表示切替"
   End With
   
  Set myCBCtrl = myCB.Controls.Add(Type:=msoControlPopup)
  With myCBCtrl
    .Caption = "入力設定"
    .OnAction = "入力設定ON"
  End With
  
   Set myCBCtrl = myCB.Controls("入力設定").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .FaceId = 984
     .Caption = "操作説明"
     .Style = msoButtonIconAndCaption
    If Val(Application.Version) <> 8 Then
     .OnAction = "入力設定操作説明"
    Else
     .OnAction = "入力設定操作説明97"
    End If
   End With
   
  Set myCBpup = myCB.Controls("入力設定").Controls.Add(Type:=msoControlPopup)
  myCBpup.Caption = "入力範囲設定"
  myCBpup.BeginGroup = True
  
   Set myCBBtn = myCBpup.Controls.Add(Type:=msoControlButton)
   With myCBBtn
     .Caption = "入力範囲ロック"
     .OnAction = "入力範囲ロック"
   End With
   
   Set myCBBtn = myCBpup.Controls.Add(Type:=msoControlButton)
   With myCBBtn
     .Caption = "一時解除"
     .OnAction = "一時解除"
   End With
   
   Set myCBBtn = myCBpup.Controls.Add(Type:=msoControlButton)
   With myCBBtn
     .Caption = "再設定"
     .OnAction = "再設定"
   End With
   
  Set myCBpup = myCB.Controls("入力設定").Controls.Add(Type:=msoControlPopup)
  With myCBpup
    .Caption = "日本語入力"
  End With
  For II% = 1 To 3
    Set myCBBtn = myCBpup.Controls.Add(Type:=msoControlButton)
    With myCBBtn
      Select Case II%
        Case 1: .Caption = "オン固定"
        Case 2: .Caption = "オフ固定"
        Case 3: .Caption = "コントロールなし"
      End Select
      .OnAction = "変換_" & Format(II%)
    End With
  Next
  '
  Set myCBpup = myCB.Controls("入力設定").Controls.Add(Type:=msoControlPopup)
  With myCBpup
    .Caption = "Enter移動"
  End With
  For II% = 1 To 5
    Set myCBBtn = myCBpup.Controls.Add(Type:=msoControlButton)
    With myCBBtn
      Select Case II%
        Case 1: .Caption = "下"
        Case 2: .Caption = "右"
        Case 3: .Caption = "上"
        Case 4: .Caption = "左"
        Case 5: .Caption = "−"
      End Select
      .OnAction = "方向_" & Format(II%, "0")
    End With
  Next

【14】つづき
Excel  ぴかる  - 02/9/2(月) 21:20 -

引用なし
パスワード
     Set myCBCtrl = myCB.Controls.Add(Type:=msoControlPopup)
  myCBCtrl.Caption = "文字変換"
    
   Set myCBCtrl = myCB.Controls("文字変換").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .FaceId = 984
     .Caption = "操作説明"
     .Style = msoButtonIconAndCaption
    If Val(Application.Version) <> 8 Then
     .OnAction = "文字変換操作説明"
    Else
     .OnAction = "文字変換操作説明97"
    End If
   End With
   
   Set myCBCtrl = myCB.Controls("文字変換").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "・全角"
     .OnAction = "全角"
     .BeginGroup = True
   End With
   
   Set myCBCtrl = myCB.Controls("文字変換").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "・半角"
     .OnAction = "半角"
   End With
   
   Set myCBCtrl = myCB.Controls("文字変換").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "・大文字"
     .OnAction = "大文字"
   End With
   
   Set myCBCtrl = myCB.Controls("文字変換").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "・小文字"
     .OnAction = "小文字"
   End With
   
  Set myCBCtrl = myCB.Controls.Add(Type:=msoControlPopup)
  myCBCtrl.Caption = "小ワザ集"
    
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "コピー・貼り付け"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技コピー貼り付け"
    Else
     .OnAction = "小技97コピー貼り付け"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "文字表示"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技文字表示"
    Else
     .OnAction = "小技97文字表示"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "表示形式"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技表示形式"
    Else
     .OnAction = "小技97表示形式"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "[Shift][Ctrl]キー"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技シフトコントロール"
    Else
     .OnAction = "小技97シフトコントロール"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "関数"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技関数"
    Else
     .OnAction = "小技97関数"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "条件付き書式"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技条件付き書式"
    Else
     .OnAction = "小技97条件付き書式"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "入力規則"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技入力規則"
    Else
     .OnAction = "小技97入力規則"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "セルの保護"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技セルの保護"
    Else
     .OnAction = "小技97セルの保護"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "データベース"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技データベース"
    Else
     .OnAction = "小技97データベース"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "マクロ"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技マクロ"
    Else
     .OnAction = "小技97マクロ"
    End If
     .FaceId = 984
   End With
   
   Set myCBCtrl = myCB.Controls("小ワザ集").Controls _
    .Add(Type:=msoControlButton)
   With myCBCtrl
     .Caption = "おまけ"
    If Val(Application.Version) <> 8 Then
     .OnAction = "小技おまけ"
    Else
     .OnAction = "小技97おまけ"
    End If
     .FaceId = 984
   End With
   
  Set myCBCtrl = myCB.Controls.Add(Type:=msoControlButton)
  With myCBCtrl
    .Style = msoButtonCaption
    .Caption = "元に戻す"
    .OnAction = "元に戻す"
  End With
    
  myCB.Visible = True

  Set myCB = Nothing: Set myCBCtrl = Nothing: Set myCBBtn = Nothing: Set myCBpup = Nothing

End Sub

  新規投稿 ┃ツリー表示 ┃一覧表示 ┃トピック表示 ┃検索 ┃設定 ┃ホーム  
107 / 107 ツリー ←次へ
ページ:  ┃  記事番号:   
0
(SS)C-BOARD v3.8 is Free