2024-11-01から1ヶ月間の記事一覧
Sub SkipErrorCells() Dim ws As Worksheet Dim cell As Range Dim result As Variant ' シートの指定 (ここではActiveSheetを使っています) Set ws = ActiveSheet ' 範囲を指定 (例えばA1からA10まで) For Each cell In ws.Range("A1:A10") On Error Resume…
VBAの用途別、適切なデータ型種類ガイドライン 参考に。。。 整数型: Integer: 小さな範囲の整数(-32,768 ~ 32,767)。 Long: 大きな整数(-2,147,483,648 ~ 2,147,483,647)。 浮動小数点型: Single: 浮動小数点数(精度が少し低い)。 Double: 高精度の…
Sub 転記() Dim folderPath As String Dim fileName As String Dim wb As Workbook Dim isOpen As Boolean Dim tempWb As Workbook Dim wsSource As Worksheet Dim wsTarget As Worksheet Dim lastRowSource As Long Dim lastRowTarget As Long Dim key As S…
Sub 転記() Dim folderPath As String Dim fileName As String Dim wb As Workbook Dim isOpen As Boolean Dim tempWb As Workbook Dim wsSource As Worksheet Dim wsTarget As Worksheet Dim lastRowSource As Long Dim lastRowTarget As Long Dim key As S…
Sub 転記() Dim folderPath As String Dim fileName As String Dim wbSource As Workbook ' アクティブブック Dim wsSource As Worksheet ' アクティブブックのシート Dim wbTarget As Workbook ' 指定したブック Dim wsTarget As Worksheet ' 指定したシー…
Sub 配列による転記() Dim folderPath As String Dim fileName As String Dim wbSource As Workbook ' アクティブブック Dim wsSource As Worksheet ' アクティブブックのシート Dim wbTarget As Workbook ' 指定したブック Dim wsTarget As Worksheet ' 指…
Sub データ更新() Dim folderPath As String Dim fileName As String Dim wb As Workbook Dim ws As Worksheet Dim targetWs As Worksheet Dim tempWs As Worksheet Dim lastRow As Long Dim targetRow As Long Dim i As Long Dim j As Long Dim conditionCo…
’~実例コード~ ' フィルターがかかっている場合、フィルターを解除 If wsData.AutoFilterMode Then wsData.ShowAllData ' フィルター解除 End If
#M:: { if (IsUpDisplayPrimary) { ; 下ディスプレイをメインに設定 Run, C:\_cmd\multimonitortool-x64\MultiMonitorTool.exe /SetPrimary 2 IsUpDisplayPrimary := false } else { ; 上ディスプレイをメインに設定 Run, C:\_cmd\multimonitortool-x64\Mult…
' Excelアプリケーションを起動Set objExcel = CreateObject("Excel.Application")objExcel.Visible = True ' ドラッグ&ドロップで渡された引数(2つのファイルパス)を取得Set objArgs = WScript.Arguments ' 引数が2つであることを確認If objArgs.Count <…
Sub 特定の送信者からのメールtxt保存() Dim olApp As Outlook.Application Dim olNs As Outlook.Namespace Dim olFolder As Outlook.MAPIFolder Dim senderEmail As String Dim savePath As String Dim count As Integer Dim specifiedDate As Date Dim dat…
Sub 日付指定してDataから対象を抽出2() Dim wsSearch As Worksheet Dim wsResult As Worksheet Dim searchDate As Date Dim resultArray() As Variant Dim matchCount As Long Dim folderPath1 As String Dim folderPath2 As String Dim fileName As String…
Sub S日付指定してDataから対象を抽出() Dim wsData As Worksheet Dim wsSearch As Worksheet Dim wsResult As Worksheet Dim searchDate As Date Dim dataArray As Variant Dim resultArray() As Variant Dim i As Long, resultRow As Long Dim lastRow As …
Sub ExtractDataToSheet1AndCompare() Dim folderPath As String Dim wb As Workbook Dim ws1 As Worksheet Dim sampleWs As Worksheet Dim compatibilityWs As Worksheet Dim lastRow As Long Dim i As Long Dim regex As Object Dim compatLastRow As Long…