「Excel VBA」の版間の差分
ナビゲーションに移動
検索に移動
(→ライブラリ) |
|||
| 148行目: | 148行目: | ||
*[[Excel VBA 最初の空白でないセルを返す]] | *[[Excel VBA 最初の空白でないセルを返す]] | ||
===ライブラリ=== | ===ライブラリ=== | ||
| + | |||
| + | ====[https://github.com/VBA-tools/VBA-JSON VBA-JSON]==== | ||
| + | *[https://github.com/VBA-tools/VBA-JSON VBA-JSON] | ||
| + | |||
| + | ====部品==== | ||
*[[Excel VBA Utility]] | *[[Excel VBA Utility]] | ||
*[[Excel VBA File Utility]] | *[[Excel VBA File Utility]] | ||
*[[Excel VBA Log Utility]] | *[[Excel VBA Log Utility]] | ||
| + | |||
| + | ====その他==== | ||
*{{ref レコード末尾にC[[R]]LF挿入v10.xls}} | *{{ref レコード末尾にC[[R]]LF挿入v10.xls}} | ||
**{{ref recsplt.exe}} VC++版 ↑遅すぎ | **{{ref recsplt.exe}} VC++版 ↑遅すぎ | ||
2021年11月6日 (土) 01:20時点における版
| Excel |
目次
Excel VBA
Tips
Excel操作
セルからテキストを取得
最終更新日を取得
シートを設定ファイルとして利用する
ユーザフォームを閉じさせない
確認のダイアログを表示させない
最後のセルを取得
オートフィルタをシート間で同期
オートフィルタをで行が隠れているか判定
シート名を指定してハイパーリンクを作成
すべてのシートに対して一括置換
処理中一時的に自動計算をとめる
選択された範囲を処理==
If TypeName(Selection) = "Range" Then
For Each c In Selection.Cells
Debug.Print c.Value
Next
End If
文字列操作
数値操作
ステートメント
ファイル操作
ディレクトリの存在チェック
If Dir(pathName, vbDirectory) = "" Then : End If
オブジェクト操作
起動メニューアイコンを表示
Private Const MY_APP_FILE_MK As String = "ツールバー名" 'ツールバー名
Private Const BTN_MY_APP_FILE_MK As String = "ボタン名" 'ボタン名
'
'ToolBarをセット
'
Private Sub loadToolBar()
Dim cbrGatherImgs As CommandBar
Dim btnGetImages As CommandBarButton
On Error Resume Next
' コマンド バーが既に存在するかどうかを確認します。
' Set cbrGatherImgs = CommandBars(MY_APP_FILE_MK)
' コマンド バーが存在しない場合は作成します。
If cbrGatherImgs Is Nothing Then
Err.clear
Set cbrGatherImgs = CommandBars.add(MY_APP_FILE_MK)
' コマンド バーを表示します。
cbrGatherImgs.Visible = True
' ボタン コントロールを追加します。
Set btnGetImages = cbrGatherImgs.Controls.add
With btnGetImages
.Style = msoButtonIconAndCaption
.Caption = BTN_MY_APP_FILE_MK
.Tag = BTN_MY_APP_FILE_MK
' ボタンがクリックされたときに実行するプロシージャを指定します。
.OnAction = "mayAppMain"
.FaceId = 270&
End With
Else
' 既存のコマンド バーを表示します。
cbrGatherImgs.Visible = True
End If
End Sub
'
'ToolBarを削除
'
Private Sub unloadToolBar()
'On Error Resume Next
On Error GoTo errHandler
' 存在するコマンド バーを削除します。
CommandBars(MY_APP_FILE_MK).Delete
Exit Sub
errHandler:
'NOP
End Sub
'
'ファイルを開いたときに実行
'
Public Sub Auto_Open()
Call loadToolBar
End Sub
'
'ファイルを閉じたときに実行
'
Public Sub Auto_Close()
Call unloadToolBar
End Sub
マクロサンプル
ライブラリ
VBA-JSON
部品
その他
- {{ref レコード末尾にCRLF挿入v10.xls}}
- テンプレート:Ref recsplt.exe VC++版 ↑遅すぎ
- Excel VBA プロパティのコードを生成する
- ファンクションポイント 簡易マクロ
- Visio ER図の情報を取得する
- テーブル定義からJavaプロパティ名称作成
© 2006 矢木浩人