hiko-blog

VBA業務改善

MENU

2024-01-21から1日間の記事一覧

選択メールのみ添付ファイル削除

VBA

Sub 選択メールの添付ファイル削除() Set myOlApp = CreateObject("Outlook.Application") Set myOlSel = myOlApp.ActiveExplorer.Selection If myOlSel.Count = 0 Then MsgBox "メールが選択されていません" Exit Sub End If If vbYes <> MsgBox(myOlSel.Co…

OUTLOOKテキストにメール保存

VBA

Sub SaveOutlookMessagesWithDifferentFilenames() Dim olApp As Object Dim olNamespace As Object Dim olFolder As Object Dim olItem As Object Dim strOutputFolder As String Dim fs As Object Dim outFile As Object Dim isSentByMe As Boolean ' Outl…

Outlookで不要添付ファイル削除する

VBA

Outlookを開き、 「開発」タブを有効にする。 「Visual Basic」をクリックしてVBAエディタを開く。 「挿入」メニューから「モジュール」を選択して下記VBA貼り付け。 Sub RemoveAttachmentsFromSelectedEmails() Dim selectedItems As Selection Set selecte…

バッチでランチャ

@echo offtitle MyLauncher :: ウィンドウの列数を変更(例: 100)mode con cols=100 :: ウィンドウの行数を変更(例: 30)mode con lines=30 set "Ph1=C:\Program Files\Google\Chrome\Application\chrome.exe"set "Ph2=D:\***\IDM.exe"set "Ph3=D:\***\Mer…

フォルダ内、検索vbs

VBS

' FileSearchWithOutput.vbs Dim folderPath, searchValue, outputFilefolderPath = InputBox("フォルダのパスを入力してください:")searchValue = InputBox("検索する部分文字列を入力してください:")outputFile = "output.txt" If folderPath = "" Or sear…

KEY列の比較とリスト化

VBA

Sub KEY列の比較とリスト化() Dim ws1 As Worksheet, ws2 As Worksheet, wsResult As Worksheet Dim cell1 As Range, cell2 As Range Dim keyColumn As Integer Dim notFoundInSheet1 As String, notFoundInSheet2 As String Dim resultRow, resultRow2 As L…