全181件 (181件中 1-50件目)
了解しました。PowerShellスクリプトを、スクリプトが保存されているフォルダ内で実行するように修正します。これにより、個々のフォルダパスを指定する必要がなくなります。### 修正版 PowerShellスクリプト以下のスクリプトを使用して、スクリプトが保存されているフォルダ内のすべてのvCardファイルを一括でOutlookにインポートします。1. **メモ帳を開く**: メモ帳を開きます。2. **以下のPowerShellスクリプトをコピーして貼り付ける**: ```powershell $scriptPath = $PSScriptRoot # スクリプトが保存されているフォルダのパスを取得 $outlook = New-Object -ComObject Outlook.Application $namespace = $outlook.GetNamespace("MAPI") $contactsFolder = $namespace.GetDefaultFolder([Microsoft.Office.Interop.Outlook.OlDefaultFolders]::olFolderContacts) Get-ChildItem -Path $scriptPath -Filter *.vcf | ForEach-Object { $vcfFile = $_.FullName try { $contactItem = $outlook.CreateItemFromTemplate($vcfFile) $contactItem.Move($contactsFolder) Write-Host "Imported: $vcfFile" } catch { Write-Host "Failed to import: $vcfFile - $_" } } ```3. **この内容を `import_vcf.ps1` という名前で保存**: 保存する場所は、.vcfファイルが保存されているフォルダと同じ場所にします。#### 手順2: PowerShellスクリプトの実行1. **PowerShellを管理者権限で開く**: Windowsのスタートメニューから「PowerShell」と検索し、「管理者として実行」を選択します。2. **スクリプトの実行ポリシーを設定**: スクリプトの実行を許可するために、以下のコマンドを入力します: ```powershell Set-ExecutionPolicy RemoteSigned ```3. **スクリプトを実行**: PowerShellで、スクリプトを保存したディレクトリに移動し、以下のコマンドを入力してスクリプトを実行します: ```powershell cd "C:\path\to\script" # ここを実際のスクリプト保存場所に変更 ./import_vcf.ps1 ```これにより、スクリプトが保存されているフォルダ内のすべてのvCardファイルがOutlookの連絡先に一括でインポートされます。### 注意事項- スクリプトの実行前に、必ずOutlookがインストールされていることを確認してください。- PowerShellスクリプトを実行するための権限が必要です。- スクリプトの実行ポリシーを設定する際には、セキュリティリスクを理解し、必要に応じて設定を戻してください。この方法で、個々のフォルダパスを指定することなく、複数のvCardファイルを一括でOutlookにインポートすることができます。
2024年05月17日
コメント(0)
了解しました。以下のコードは、Excelマクロが格納されているフォルダを自動的に取得し、そのフォルダ内のすべての.vcfファイルをOutlookの連絡先にインポートするように変更したものです。### 修正版 VBAコード1. **Excelを開く**: Excelを開きます。2. **VBAエディタを開く**: `Alt + F11`を押してVBAエディタを開きます。3. **新しいモジュールを作成する**: `Insert > Module`を選択して新しいモジュールを作成します。4. **以下のコードを新しいモジュールに貼り付ける**:```vbaSub ImportVCFtoOutlookContacts() Dim objOutlook As Object Dim objNamespace As Object Dim objContactsFolder As Object Dim objVCFItem As Object Dim fso As Object Dim folderPath As String Dim file As Object Dim vcfFilePath As String Dim wb As Workbook ' 現在のワークブックのパスを取得 Set wb = ThisWorkbook folderPath = wb.Path ' Outlookアプリケーションを取得 On Error Resume Next Set objOutlook = GetObject(, "Outlook.Application") If objOutlook Is Nothing Then Set objOutlook = CreateObject("Outlook.Application") End If On Error GoTo 0 ' Namespaceと連絡先フォルダを取得 Set objNamespace = objOutlook.GetNamespace("MAPI") Set objContactsFolder = objNamespace.GetDefaultFolder(10) ' 10 = olFolderContacts ' FileSystemObjectを使用してフォルダ内のファイルを操作 Set fso = CreateObject("Scripting.FileSystemObject") ' フォルダ内のすべての.vcfファイルを処理 For Each file In fso.GetFolder(folderPath).Files If LCase(fso.GetExtensionName(file.Name)) = "vcf" Then vcfFilePath = file.Path Set objVCFItem = objOutlook.CreateItemFromTemplate(vcfFilePath) objVCFItem.Move objContactsFolder End If Next MsgBox "すべてのvCardファイルがOutlookの連絡先にインポートされました。"End Sub```5. **Excelからマクロを実行**: - VBAエディタを閉じ、Excelに戻ります。 - `Alt + F8`を押してマクロダイアログを開き、`ImportVCFtoOutlookContacts`を選択して実行します。### 説明- `folderPath = wb.Path` によって、マクロが格納されているExcelファイルのフォルダパスを取得します。- そのフォルダ内のすべての.vcfファイルを検出し、Outlookの連絡先にインポートします。これにより、ユーザーごとに異なるフォルダパスを手動で設定する必要がなくなり、Excelマクロが格納されているフォルダ内の.vcfファイルを一括でインポートすることができます。
2024年05月17日
コメント(0)
Private Sub CommandButton1_Click() Dim chkBoxes() As Control Dim i As Integer Dim j As Integer Dim isChecked As Boolean Dim index As Integer isChecked = False ' 各大項目の小項目の数 Dim subItems As Variant subItems = Array(9, 10, 3, 5, 6, 4, 8, 7, 2) ' 例として大項目1から9の小項目の数 ' チェックボックスの数を合計して配列を初期化 Dim totalCheckboxes As Integer totalCheckboxes = 0 For i = LBound(subItems) To UBound(subItems) totalCheckboxes = totalCheckboxes + subItems(i) Next i ReDim chkBoxes(1 To totalCheckboxes) ' 配列にチェックボックスを格納 index = 1 For i = 1 To UBound(subItems) + 1 For j = 1 To subItems(i - 1) Set chkBoxes(index) = Me.Controls(i & "_" & j) index = index + 1 Next j Next i ' 配列内のチェックボックスを確認 For i = LBound(chkBoxes) To UBound(chkBoxes) Debug.Print "Checkbox " & chkBoxes(i).Name & " Value: " & chkBoxes(i).Value If chkBoxes(i).Value = 1 Then isChecked = True Exit For End If Next i ' 全てのチェックボックスが未チェックの場合の処理 If Not isChecked Then MsgBox "少なくとも一つのチェックボックスを選択してください。", vbExclamation, "選択エラー" End IfEnd Sub
2024年05月14日
コメント(0)
Private Sub CommandButton1_Click() Dim chkBoxes() As Control Dim i As Integer Dim j As Integer Dim isChecked As Boolean Dim index As Integer isChecked = False ' 各大項目の小項目の数 Dim subItems() As Integer subItems = Array(9, 10, 3, 5, 6, 4, 8, 7, 2) ' 例として大項目1から9の小項目の数 ' チェックボックスの数を合計して配列を初期化 Dim totalCheckboxes As Integer totalCheckboxes = 0 For i = LBound(subItems) To UBound(subItems) totalCheckboxes = totalCheckboxes + subItems(i) Next i ReDim chkBoxes(1 To totalCheckboxes) ' 配列にチェックボックスを格納 index = 1 For i = 1 To UBound(subItems) + 1 For j = 1 To subItems(i - 1) Set chkBoxes(index) = Me.Controls(i & "_" & j) index = index + 1 Next j Next i ' 配列内のチェックボックスを確認 For i = LBound(chkBoxes) To UBound(chkBoxes) If chkBoxes(i).Value = True Then isChecked = True Exit For End If Next i ' 全てのチェックボックスが未チェックの場合の処理 If Not isChecked Then MsgBox "少なくとも一つのチェックボックスを選択してください。", vbExclamation, "選択エラー" End IfEnd Sub
2024年05月14日
コメント(0)
Private Sub CommandButton1_Click() Dim chkBoxes(1 To 49) As Control Dim i As Integer Dim isChecked As Boolean isChecked = False ' チェックボックスを配列に格納 For i = 1 To 49 Set chkBoxes(i) = Me.Controls("Checkbox" & i) Next i ' 配列内のチェックボックスを確認 For i = 1 To 49 If chkBoxes(i).Value = True Then isChecked = True Exit For End If Next i ' 全てのチェックボックスが未チェックの場合の処理 If Not isChecked Then MsgBox "少なくとも一つのチェックボックスを選択してください。", vbExclamation, "選択エラー" End IfEnd Sub
2024年05月14日
コメント(0)
Sub SummarizeExcelData() Dim xlApp As Excel.Application Dim wb1 As Excel.Workbook, wb2 As Excel.Workbook, wb3 As Excel.Workbook Dim ws1_1 As Excel.Worksheet, ws2_1 As Excel.Worksheet, ws3 As Excel.Worksheet Dim Total1 As Double, Total2 As Double, Total3 As Double Dim filePath1 As String, filePath2 As String, filePath3 As String ' Excelファイルのパスを設定します(ここで正しいパスに変更してください) filePath1 = "C:\Path\To\集計1.xlsx" filePath2 = "C:\Path\To\集計2.xlsx" filePath3 = "C:\Path\To\集計3.xlsx" ' Excelアプリケーションのインスタンスを作成 Set xlApp = New Excel.Application xlApp.Visible = False ' Excelのウィンドウを非表示にする ' ワークブックを開く Set wb1 = xlApp.Workbooks.Open(filePath1) Set wb2 = xlApp.Workbooks.Open(filePath2) Set wb3 = xlApp.Workbooks.Open(filePath3) ' ワークシートを設定 Set ws1_1 = wb1.Sheets("sheet1") Set ws2_1 = wb2.Sheets("sheet1") Set ws3 = wb3.Sheets("集計3") ' 各セルから値を取得 Total1 = ws1_1.Range("N62").Value Total2 = ws2_1.Range("N62").Value Total3 = ws3.Range("D2").Value ' 結果を表示 ws3.Range("E1").Value = "集計結果" ws3.Range("E2").Value = Total3 & "(" & Total2 & "," & Total1 & ")" ' ワークブックを保存して閉じる wb1.Close False wb2.Close False wb3.Save wb3.Close ' Excelアプリケーションを閉じる xlApp.Quit ' オブジェクトの解放 Set ws1_1 = Nothing Set ws2_1 = Nothing Set ws3 = Nothing Set wb1 = Nothing Set wb2 = Nothing Set wb3 = Nothing Set xlApp = Nothing ' 完了メッセージ MsgBox "集計が完了しました。", vbInformation, "完了" ' "集計3"を開く Set xlApp = New Excel.Application xlApp.Visible = True Set wb3 = xlApp.Workbooks.Open(filePath3) Set ws3 = wb3.Sheets("集計3")End Sub
2024年05月09日
コメント(0)
Sub UpdateExcelSheet() ' Excelオブジェクトを定義 Dim xlApp As Object Dim xlBook As Object Dim xlSheet As Object Dim filePath As String ' Excelファイルのパス filePath = "C:\path\to\your\file.xlsx" ' 実際のファイルパスに変更してください ' Excelアプリケーションを開始 Set xlApp = CreateObject("Excel.Application") ' ファイルを開く Set xlBook = xlApp.Workbooks.Open(filePath) ' "Sheet2"をアクティブにする Set xlSheet = xlBook.Sheets("Sheet2") ' B1からB9までの合計をB10に設定 xlSheet.Range("B10").Value = xlApp.WorksheetFunction.Sum(xlSheet.Range("B1:B9")) ' ファイルを保存して閉じる xlBook.Save xlBook.Close ' Excelアプリケーションを終了 xlApp.Quit ' オブジェクトの解放 Set xlSheet = Nothing Set xlBook = Nothing Set xlApp = Nothing MsgBox "更新が完了しました。", vbInformationEnd Sub
2024年05月08日
コメント(0)
Sub AddSheetAndTransferData() Dim excelApp As Object Dim wb As Object Dim ws As Object Dim wsSource As Object Dim filePath As String Dim i As Integer Dim sheetExists As Boolean ' Excelファイルのパスを設定 filePath = "C:\Path\To\Your\ExcelFile.xlsx" ' ここにファイルのパスを入力してください ' Excelアプリケーションを開始 Set excelApp = CreateObject("Excel.Application") excelApp.Visible = True ' Excelを表示 ' 指定されたファイルを開く Set wb = excelApp.Workbooks.Open(filePath) ' Sheet2が存在するかどうかを確認 sheetExists = False For Each ws In wb.Sheets If ws.Name = "Sheet2" Then sheetExists = True Exit For End If Next ws ' Sheet2が存在しなければ追加 If Not sheetExists Then Set ws = wb.Sheets.Add(After:=wb.Sheets(wb.Sheets.Count)) ws.Name = "Sheet2" Else Set ws = wb.Sheets("Sheet2") End If ' A1からA9に1から9までの番号を入力 For i = 1 To 9 ws.Cells(i, 1).Value = i Next i ' Sheet1から特定のデータをSheet2に転送 Set wsSource = wb.Sheets("Sheet1") ' Sheet1が存在すると仮定 Dim cellAddresses As Variant cellAddresses = Array("N2", "N22", "N33", "N37", "N42", "N45", "N51", "N55", "N57") For i = 0 To UBound(cellAddresses) ws.Cells(i + 1, 2).Value = wsSource.Range(cellAddresses(i)).Value Next i ' 変更を保存してファイルを閉じる wb.Save wb.Close ' オブジェクトを解放 Set ws = Nothing Set wsSource = Nothing Set wb = Nothing Set excelApp = NothingEnd Sub
2024年04月26日
コメント(0)
Sub 合計を計算して入力() Dim xlApp As Excel.Application Dim xlWorkbook As Excel.Workbook Dim xlSheet As Excel.Worksheet Dim i As Integer Dim sumRange As Excel.Range Dim sumResult As Double Set xlApp = New Excel.Application xlApp.Visible = True ' Excelを表示する ' Excelファイルを開く(ファイルパスは適宜変更してください) Set xlWorkbook = xlApp.Workbooks.Open("C:\path\to\your\excel\file.xlsx") Set xlSheet = xlWorkbook.Sheets("シート名") ' シート名を適宜変更してください ' B列からM列までの合計を計算して、B2からM2に入力 For i = 2 To 13 ' Excelの列番号 B=2, M=13 Set sumRange = xlSheet.Range(xlSheet.Cells(3, i), xlSheet.Cells(21, i)) sumResult = Application.Sum(sumRange) xlSheet.Cells(2, i).Value = sumResult Next i ' 変更を保存し、Excelファイルを閉じる xlWorkbook.Save xlWorkbook.Close xlApp.Quit ' オブジェクトを解放 Set xlSheet = Nothing Set xlWorkbook = Nothing Set xlApp = NothingEnd Sub
2024年04月16日
コメント(0)
Sub FindTopLevelFoldersImproved() Dim wsLog As Worksheet, wsSheet2 As Worksheet Dim lastRow As Long, lastCol As Long, i As Long, j As Long Dim dictFolders As Object, listTopFolders As Object Dim userId As Variant, folderPath As Variant, checkPath As Variant Dim isTopFolder As Boolean Dim row As Long Set wsLog = ThisWorkbook.Sheets("log") Set wsSheet2 = ThisWorkbook.Sheets("Sheet2") Set dictFolders = CreateObject("Scripting.Dictionary") Set listTopFolders = CreateObject("Scripting.Dictionary") lastRow = wsLog.Cells(wsLog.Rows.Count, "A").End(xlUp).Row lastCol = wsLog.Cells(1, wsLog.Columns.Count).End(xlToLeft).Column ' 全てのフォルダパスを収集 For i = 2 To lastRow For j = 4 To lastCol ' D列から始まるアクセス権者ID If wsLog.Cells(i, j).Value = "○" Then folderPath = wsLog.Cells(i, 1).Value userId = wsLog.Cells(1, j).Value If Not dictFolders.Exists(userId) Then Set dictFolders(userId) = CreateObject("Scripting.Dictionary") End If dictFolders(userId)(folderPath) = True End If Next j Next i ' Sheet2をクリア wsSheet2.Cells.ClearContents wsSheet2.Cells(1, 1).Value = "権利者" wsSheet2.Cells(1, 2).Value = "最上層フォルダ" row = 2 ' 最上層フォルダを特定 For Each userId In dictFolders.Keys Set listTopFolders = CreateObject("Scripting.Dictionary") For Each folderPath In dictFolders(userId).Keys isTopFolder = True For Each checkPath In dictFolders(userId).Keys If folderPath <> checkPath And InStr(1, folderPath & "\", checkPath & "\") > 0 Then isTopFolder = False Exit For End If Next checkPath ' フォルダが最上層であればリストに追加 If isTopFolder Then If Not listTopFolders.Exists(folderPath) Then listTopFolders.Add folderPath, True End If End If Next folderPath ' 特定された最上層フォルダをSheet2に出力 For Each folderPath In listTopFolders.Keys wsSheet2.Cells(row, 1).Value = userId wsSheet2.Cells(row, 2).Value = folderPath row = row + 1 Next folderPath Next userId MsgBox "最上層フォルダの特定が完了しました。", vbInformationEnd Sub
2024年02月12日
コメント(0)
Sub FindTopFolderForUser() Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("アクセス権情報") ' シート名を指定 Dim lastRow As Long lastRow = ws.Cells(ws.Rows.Count, 4).End(xlUp).Row ' D列以降にIDが含まれていると仮定 Dim folderColumn As Integer folderColumn = 1 ' フォルダのパスが含まれている列(A列を示す場合) Dim r As Long Dim folderFound As Boolean folderFound = False For r = 3 To lastRow ' 開始行を適切な行に変更してください If ws.Cells(r, 23).Value = "○" Then ' W列に権限のマークがあると仮定 ' 権限がある最上位のフォルダを取得する関数を呼び出して、結果を表示 Dim topFolder As String topFolder = GetTopFolder(ws.Cells(r, folderColumn).Value) If topFolder <> "" Then MsgBox "権限がある最上位のフォルダ: " & topFolder folderFound = True Exit For End If End If Next r If Not folderFound Then MsgBox "指定されたユーザーに権限があるフォルダが見つかりませんでした。" End IfEnd SubFunction GetTopFolder(folderPath As String) As String ' フォルダのパスから最上位のフォルダを取得する関数 Dim folders() As String folders = Split(folderPath, "\") GetTopFolder = folders(UBound(folders) - 1)End Function
2024年02月09日
コメント(0)
Function FindTopFolderWithPermission(username As String, startingRow As Integer, folderColumn As Integer, permissionColumns As Range) As String Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("アクセス権情報") ' シート名を指定 Dim lastRow As Long lastRow = ws.Cells(ws.Rows.Count, folderColumn).End(xlUp).Row Dim i As Integer For i = startingRow To lastRow Dim folderPath As String folderPath = ws.Cells(i, folderColumn).Value ' 権限者のセルが空でないか確認 Dim permissionCell As Range Set permissionCell = permissionColumns.Find(username, LookIn:=xlValues, LookAt:=xlWhole) If Not permissionCell Is Nothing Then ' 権限者が見つかった場合、フォルダの親を取得 Dim parentFolder As String parentFolder = GetParentFolder(folderPath) If parentFolder <> "" Then FindTopFolderWithPermission = parentFolder Exit Function End If End If Next i ' 見つからなかった場合は空文字列を返す FindTopFolderWithPermission = ""End FunctionFunction GetParentFolder(folderPath As String) As String ' フォルダのパスから親フォルダを取得する関数 Dim parentFolder As String Dim parts() As String parts = Split(folderPath, "\") If UBound(parts) > 0 Then ReDim Preserve parts(UBound(parts) - 1) parentFolder = Join(parts, "\") End If GetParentFolder = parentFolderEnd Function申し訳ありません、先ほどのコードを修正します。VBAでは、ユーザー定義関数とサブルーチンを同じモジュール内に直接記述することはできません。代わりに、ユーザー定義関数を含む別のモジュールを作成し、それをサブルーチンから呼び出す必要があります。以下が修正された手順です。1. ユーザー定義関数を新しいモジュールにコピーします。2. サブルーチンのあるモジュールで、新しいモジュールを参照します。具体的な手順は以下の通りです。1. ユーザー定義関数用の新しいモジュールを作成し、以下のコードを貼り付けます。```vbaOption ExplicitFunction FindTopFolderWithPermission(username As String, startingRow As Integer, idColumn As Integer, folderColumn As Integer, permissionColumns As Range) As String Dim ws As Worksheet Dim i As Integer Dim folderPath As String Dim permission As Range ' アクティブなワークシートを取得 Set ws = ThisWorkbook.ActiveSheet ' 最上位のフォルダを初期化 FindTopFolderWithPermission = "" ' 権限があるかどうかをチェック For Each permission In permissionColumns If permission.Value = username Then ' 権限がある場合は、対応する行のフォルダを取得 folderPath = ws.Cells(permission.Row, folderColumn).Value Exit For End If Next permission ' フォルダが見つかった場合、最上位のフォルダを取得 If folderPath <> "" Then Dim folders() As String folders = Split(folderPath, "\") ' 起点から上位のフォルダを取得 If UBound(folders) >= 2 Then FindTopFolderWithPermission = folders(0) & "\" & folders(1) Else FindTopFolderWithPermission = folders(0) End If End IfEnd Function```2. サブルーチンがあるモジュールで、新しいモジュールを参照します。サブルーチンのモジュール内に以下のコードを貼り付けます。```vbaOption ExplicitSub CheckAndMarkIDsOptimized() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("アクセス権情報") ' シート名を指定 Dim lastRow As Long Dim lastCol As Long Dim r As Long, c As Long Dim id As String Dim cellContent As String lastCol = ws.Cells(1, Columns.Count).End(xlToLeft).Column lastRow = ws.Cells(Rows.Count, 3).End(xlUp).Row ' ID列(D列以降)をループ For c = 4 To lastCol id = ws.Cells(1, c).Value ' IDを取得 ' C列の各行をループしてIDを検索 For r = 2 To lastRow cellContent = ws.Cells(r, 3).Value ' C列の値 ws.Cells(r, c).Value = IIf(InStr(cellContent, id) > 0, "〇", "") ' 該当するIDの場合、「〇」をマーク Next r Next c Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = TrueEnd Sub```このようにすることで、関数とサブルーチンが同じモジュール内に含まれることなく、正しく動作するはずです。
2024年02月09日
コメント(0)
Sub CalculateHierarchyAndAdjustFor5thLevelCorrected() Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("アクセス権情報") ' シート名を指定 Dim lastRow As Long Dim r As Long Dim path As String Dim hierarchy As Long Dim adjustedHierarchy As Long lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row ' A列のデータをループ、3行目から開始 For r = 3 To lastRow path = ws.Cells(r, 1).Value ' 階層数を計算(先頭の \\ を考慮) hierarchy = Len(path) - Len(Replace(path, "\", "")) ' 5階層目を1として階層数を調整 adjustedHierarchy = hierarchy - 4 If adjustedHierarchy < 1 Then adjustedHierarchy = 1 ' 5階層目以下は全て1 ' B列に階層数を入力 ws.Cells(r, 2).Value = adjustedHierarchy ' C列にA列とB列の値を結合して入力 ws.Cells(r, 3).Value = path & " " & adjustedHierarchy Next rEnd Sub
2024年02月08日
コメント(0)
Sub CheckAndMarkIDs() Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("log") ' シート名を指定 Dim lastRow As Long Dim lastCol As Long Dim r As Long, c As Long Dim idCell As Range Dim id As String Dim cellContent As String lastCol = ws.Cells(1, Columns.Count).End(xlToLeft).Column lastRow = ws.Cells(Rows.Count, 3).End(xlUp).Row ' ID列(D列以降)をループ For c = 4 To lastCol Set idCell = ws.Cells(1, c) id = idCell.Value ' IDを取得 ' C列の各行をループしてIDを検索 For r = 2 To lastRow cellContent = ws.Cells(r, 3).Value ' C列の値 If InStr(1, cellContent, id, vbTextCompare) > 0 Then ws.Cells(r, c).Value = "〇" ' 該当するIDの場合、「〇」をマーク Else ws.Cells(r, c).Value = "" ' 該当しない場合はクリア End If Next r Next cEnd SubSub CheckAndMarkIDsOptimized() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("log") ' シート名を指定 Dim lastRow As Long Dim lastCol As Long Dim r As Long, c As Long Dim id As String Dim cellContent As String lastCol = ws.Cells(1, Columns.Count).End(xlToLeft).Column lastRow = ws.Cells(Rows.Count, 3).End(xlUp).Row ' ID列(D列以降)をループ For c = 4 To lastCol id = ws.Cells(1, c).Value ' IDを取得 ' C列の各行をループしてIDを検索 For r = 2 To lastRow cellContent = ws.Cells(r, 3).Value ' C列の値 ws.Cells(r, c).Value = IIf(InStr(cellContent, id) > 0, "〇", "") ' 該当するIDの場合、「〇」をマーク Next r Next c Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = TrueEnd Sub 行の開始位置:For r = 2 To lastRowの部分で指定されています。この例では2行目から開始していますが、3行目から開始したい場合は2を3に変更します。列の開始位置:For c = 4 To lastColの部分で指定されています。この例では4列目(D列)から開始していますが、これは既にあなたの要件に合っています。
2024年02月08日
コメント(0)
サーバー上のサブフォルダーでアドミニストレーター権限がない場合、そのフォルダーを削除するにはいくつかのアプローチがあります。ただし、これらの作業はシステムに深刻な影響を及ぼす可能性があるため、慎重に行う必要があります。以下にいくつかの方法を挙げますが、サーバーのバックアップを取得してから実行してください。1. **所有権の取得**: - フォルダのプロパティに移動し、「セキュリティ」タブを選択します。 - 「詳細設定」をクリックし、「所有者」タブを開きます。 - 「編集」をクリックして、現在のユーザーまたは管理者グループを所有者として設定します。 - 所有者が変更されたら、必要な権限(フルコントロール)を自身に付与します。2. **セーフモードでの操作**: - サーバーをセーフモードで再起動し、セキュリティが緩和された状態でフォルダーの削除を試みます。3. **コマンドラインツールの使用**: - `takeown` コマンドや `icacls` コマンドを使用して、フォルダーの所有権を取得し、必要な権限を設定します。 - 例えば、`takeown /f フォルダー名 /r /d y` コマンドでフォルダーとその中身の所有権を取得できます。 - 次に、`icacls フォルダー名 /grant 管理者名:F /t` コマンドでフルアクセス権限を付与します。4. **サードパーティのツール**: - サードパーティ製のファイル管理ツールを使用して、より高度な権限でフォルダーにアクセスし、削除を試みます。5. **システム管理者への連絡**: - 以上の手段で解決しない場合は、システムまたはネットワークの管理者に相談してください。より高度なツールや方法で対処できる場合があります。操作を行う前に、重要なデータが失われることがないように、対象のフォルダーのバックアップを取ることをお勧めします。また、これらの操作はサーバーのセキュリティポリシーに違反する可能性があるため、実行前に必要な承認を得ることが重要です。
2024年02月02日
コメント(0)
Import-Module ActiveDirectoryGet-ADComputer <コンピュータ名> | Select-Object DistinguishedName
2023年10月24日
コメント(0)
七田式で右脳開発へようこそいま調べてみたら、高濃度酸素を売り物にしているのたくさんありますね。でも効果あるかどうかはわかりません。以下のことに従って選んでください。1、まず、実際に使ってみてください。 高濃度酸素というものが自分に合うか、ということと、自分が欲しいと思っている器械で効果があるか、両方確認する必要があります。 2、酸素もピンキリあることを理解してください。 酸素入りドリンク、スプレー缶ですが、わたしは効果を感じたことがありません。 酸素バーのようなお店、酸素カプセルは効果がありました。 正直、安かろう、悪かろうはあると思います。 あと、一定時間(15-20分以上?)摂取し続けないとわかりにくいみたいです。 でも、はっきり言います。 高くても、空気清浄機やエアコンで酸素云々と謳っているやつは、高いくせに効果を感じたことはありませんでした。 「どうせなら空気清浄機能もあったほうが…」なんて考えてたら痛い目にあいます。 某ネットワークビジネスに引っかからないよう注意してください。3、あ、すみません。目的を確認しておきましょう。 目的は脳の活性化です。 脳を効率よく活用するためのいちプロセスとしての高酸素摂取です。 右脳開発が目標です。 どの酸素ドリンクが美味か?とかを問題にしているわけではないですから、その点だけお願いします。4、家庭用機器にもいろいろあります。以前紹介したこういうやつ。お金がある方はどうぞ。そういうのはちょっと置いておきまして、ここで述べたいのは、器械のほかに何かを入れないといけないもの、もあるということなんです。ああ、めんどくさいんで具体例を挙げます。営業妨害してごめんなさい。酸素パウダーを入れないといけないらしい。それだけで使えるものを選びましょう。これも悪くないと思います。でも、よく使うのはこれです。【送料無料】ナショナル 酸素エアチャージャー MS-X2-Wやはり、使ったことがあるのは自信持ってお勧めできますからね。あ、この件に関しては、遠慮なく質問ください。
2006年10月13日
コメント(1)
七田式で右脳開発へようこそhttp://news.mixi.jp/view_news.pl?id=100869&media_id=2 酸素いいっすよね。 この高濃度酸素っていうのは、やってみて結構体感というか実感が出やすいもんですな。 気持ちいいとかすっきりするとかさっぱりするとか。 個人的にそういうのには敏感だから、結構効果出易いんですが、 これはニブチンでも効果がわかりやすいので、お勧めではあります。 2万円くらいで買えたんじゃないかな。【送料無料】ナショナル 酸素エアチャージャー MS-X2-W
2006年10月13日
コメント(0)
七田式で右脳開発へようこそ体調悪くて酸素カプセルに再び行ってきました。すごく効果あり。わたしには。写真はちょっと違うんだけど、たまたま金曜日、テレビで芸能人が自宅で使ってるって言ってた。っていうかいくらすると思ってんの??芸能人ってすごいですよね。このあいだも、あだちゆみの旦那が、結婚1周年の記念日にフォーシーズンホテルの17万の部屋に泊まって、30万のバックあげたって。ちょっと引いた…
2006年10月13日
コメント(0)
七田式で右脳開発へようこそ速聴・超高速音声について興味ありますか?以前にも少し紹介しましたが。結論から先に申しますと、今の時代、高い機械を買わなくても、PCさえあれば自分で作れるんですよね、速聴音声というのか音源というのか知りませんが。ボイスセミナーとか講演会のテープとかそういうのたくさんあるじゃないですか。ああいうの、1.5倍とか2倍とかで聴けると時間の短縮になっていいと思いますよね。何度でも聴けるし。しかも聴き取れるようになると頭の回転もよくなるらしいし。つまり速聴には2つの利点があるわけです。1、時間の短縮2、能力の向上ところがモーツァルトを倍速で聴くということが、この1年くらいで言われるようになったみたいですが、これがホントすごいんですよね。集中の具合が半端じゃないんです。3、クラシックの速聴で脳の活性化さらにさらに、フォーカスCDを販売していらっしゃる渡辺さんとお話したのですが、フォーカスと速聴でさらにUP!なんです。4、フォーカス+速聴でさらにUP!時間が作って、自家製速聴音声の作り方をご案内します。気になる方はいろいろ調べてみてください。ホント人生変わりますよ。
2006年10月13日
コメント(0)
誰しも何かしら他人と違うところがあって、そんなの大げさに言うほどのものじゃないんだけど、でもそれって注目してみると案外面白いかも、なんて思っています。うちの細君は、鋭いです。隠し事は無理です。ぜったい浮気なんかできません。女性の直観、というやつでしょうか??で、わたしはというと、映像力、なんて造語を作ってみちゃいました。なにかが、頭の中で見えるんですね、映像が。これが、なにがすごいって、何の役にも立たない、ってことなんです!!役に立たないですねー。ほら、人の顔覚えるの得意な人っているでしょ?一度見たら忘れないみたいな。…無理。全然無理。大の苦手。異性なんてみんな同じ顔に見えちゃう。対外的にはほんとに何も役に立たないんですが、いい面もあるんです。個人的に。いずれそういう話もしますね。
2006年10月11日
コメント(0)
フォトリーディングで有名なラーニングソリューションが提供するジーニアスコード…映像イメージという意味では、これが一番でしょうか。集中してかなりトレーニングしたこともあって、すごく効果があるように思います。●ジーニアスコードの成果についてはこちら映像力の話頭脳の果て
2006年10月11日
コメント(0)
有名なフォトリーディングこれだけは(だけじゃないけど)、なかなか身につかないです。右脳に入っている感じはすごくあるんですが、いわゆる「出力」が下手なんですよね。マスターして、インストラクターになりたいです。で、毎日練習できる施設を作りたいです。図解!あなたもいままでの10倍速く本が読める
2006年10月11日
コメント(0)
映像力の話、最後になります。読んでくれてありがとうございます。映像力には「癒し」の効果があることが分かっています。映像が見えると癒されます。癒されています。あれ?言葉にするとものすごく普通だな…???ほら、ヒーリングなんとか、ってあるじゃないですか>あれが自己生成されるわけですね。脳内麻薬ですよ、きっと。おお、やっぱしすごいじゃん。でも、決定的に体が癒される、抜群に体調がよくなるには、ある条件が必要になります。それは…映像が変化する、ことです。見ている絵が突然変わるんですね。なんというか、A→Bではなく、A→A'って感じなんですけど。これを人によってどう表現するかは微妙なところなんですが、この変化は「瞬間」なんですよ。時間をかけてではなく、ある瞬間ガラッと変わっちゃうんです。その瞬間、「あ、よかった」と感じるんですね~。翌日の体調なんて、半端じゃなくいいですよ。ホント。ま、そんな感じなんですが、いまのわたしのテーマはこれを他人の癒しに利用できないか、なんです。利用できることはわかっているので、ぜひしっかり勉強していきたいと思います。その方向性として、わたしは七田式で右脳開発を選択している、というわけです。
2006年10月11日
コメント(0)
映像力、ていうどうでもいい話の続きです。見えるのは「きれいな映像」です。写真というか動画というか。一番多いのは「水」関係ですね。川とか湖とか泉とか。あ、なんか流れてる…水が…なんて思いながら見てます。あとは、森とか木とか光とか。木漏れ日みたいなのとかね。で、これが見えるとどうなのか、なんですが、対外的にはともかく、主体的には大変な効果があるんです、これ。だからまぁ、長々といろいろ書いてるんですが…。そんなこんなで今気になっているのがこちら。七田式ミラクルサウンドBOXあ、勝手に「七田式」なんて付けちゃいけないんだ…絶対効果あると思うんだけど、費用対効果がな~
2006年10月11日
コメント(0)
さっきまで子供相手に気功をやってたんですが、見えてきましたよ、なんか映像が。夕日、です。そんなに広くない平地があって、木が一本あって、夕日が差してる感じ。一面夕焼け色というよりは黄金色でした。
2006年10月11日
コメント(0)
livedoor ニュース毎日支局長の飲酒運転記事 ネットで批判受ける いや、ほんとその通りだよ!あんたら飲酒運転したことないの?飲酒運転の車に同乗したことないの?飲酒運転見て見ぬ振りしたことないの?小説やマンガに出てくる飲酒運転にきちんと抗議したの?「自分は善人です。飲酒運転なんて信じられない!」っていう面の皮が厚いやつ多くないか?北欧のほうの飲酒運転してるとエンジンかからない機械、酒飲んでないやつが代わりにフーってやればいいじゃん、って考えたやついるだろう?善人面してんじゃねぇよ!
2006年09月28日
コメント(0)
いつまで公開なのかわからないけど、青木選手の怖い怖い映像…当時は青木選手のことぜんぜん興味がなくって、でもこの試合結果はよく覚えてる。「え~○っちゃったんだー。すごい荒っぽい日本人がいるんだなー。」荒っぽい、だったか、乱暴な、だったかそんな印象が頭にこびりついてた。やっぱり出てくる人は出てくるんだねー。
2006年09月26日
コメント(0)
http://mycasty.jp/ikeda/index_bbs.html池田聡の柔術パラダイス☆ていうか、みんな書き込もうよ!常連さんどうしたんだ??
2006年09月26日
コメント(0)
先日のSら田氏とM地氏のGiアマのビデオを、ワイズにあるPCでみせてもらった。そしたら、後ろからI出先生が、「あれ、これTップじゃねぇか?」って。なるほどこの人が伝説のTップさんか…。でもこのビデオでも青木選手のDVDに続いて絶叫していない。今回はタップすらしていない。まあ、白衣着てそんなことしてたら、自分が病院送りになっちゃうだろうから。今度(当選の連絡が本当に来たら)観に行くGiグラップリング、これの後援に「整骨院シケヤス」が入っているようなので。。。こりゃ、生Tップ氏が拝める…。いっしょに写真撮ってもらおう。青木選手はどうかな~。同日、大晦日級のカードがある方に行っちゃうかな~。というか青木選手がGiグラップリングに出ないことが不思議…。
2006年09月26日
コメント(0)
体調悪くて酸素カプセルと言うものに行ってきました。すごく効果あり。わたしにはね。写真はちょっと違うんだけど、たまたま金曜日、テレビで芸能人が自宅で使ってるって言ってた。っていうかいくらすると思ってんの??芸能人ってすごいよね。このあいだも、あだちゆみの旦那が、結婚1周年の記念日にフォーシーズンホテルの17万の部屋に泊まって、30万のバックあげたって。ちょっと引いた…
2006年09月25日
コメント(0)
昨日の柔術パラダイスで、有明の試合の一番前の席(らしい)が当たりました!!K太郎選手もいい感じでしたが、わたしは今までと変わりなく青木真也選手を応援します。でも、Giグラップリングには出ないから、K太郎選手を…まあまあ、それは置いておいて、佐々先生が出場ですから、佐々先生を応援しましょう!!本当に当選連絡来るんでしょうか…
2006年09月24日
コメント(2)
【西島洋介 vsエヴァンゲリスタ・サイボーグ 】 以前、前田日明が「K-1選手なら誰でも総合ができる」みたいなこといってたような記憶があるけど、ボクシング出身の人は苦労してるよね。 比べて寝技出身の人はそうでもないような。 ヤヒーラなんて強い強い。青木選手もそうだし。 それに、西島選手、もしかして心が優しすぎないか? 【ミルコvsシウバ】 前回の試合(PRIDE20)のときはきっちりきっちりハイをマークしてたシウバだったけど、今回それが出来なかったのは、 ミルコが進歩したからなんだろうか。 ハイの前のミドル2発が相当効果的だったのでは。【アントニオ・ホドリゴ・ノゲイラ vs ジョシュ・バーネット 】 なぜに二人は黒パンなんだろうか? なぜに青木選手のようにロングスパッツを履かないんだろうか? 「総合」って考えたときにロングスパッツにしない理由があるんだろうけど、それにしてもすべりまくってたよねー。 【セルゲイ・ハリトーノフ vsエメリヤーエンコ・アレキサンダー 】 アレキサンダーどんどん強くなっているような… 【イ・テヒョン vs ヒカルド・モラエス】 【中村和裕 vs 中尾・KISS・芳広】 スポンサーだろうとなんだろうと、 試合前にドンペン君踊らせてるやつに「PRIDEわかってねぇ」とは言われたくないもんだ。 【マウリシオ・ショーグン vs ザ・スネーク】 【ヒカルド・アローナ vsアリスター・オーフレイム 】 相変わらずえげつない。 それを置いておいても、最近人気のアローナ。 そんなにやつの試合面白いか?? 【GP決勝】 サミングという声が多いがそうは見えなかった。 サミングであろうとなかろうと、心が折れたから抗議せずタップしたってことかな。 しかし強かった…。
2006年09月10日
コメント(0)
新宿コズミックスポーツセンターで行われた柔術GIアマ関東大会で、宮地選手がマスター白帯プルーマ級で3回勝って準優勝、桜田選手が白帯アダルトペナ級で2回勝って準優勝しました!おめでとうございます。
2006年09月10日
コメント(0)
痛み止め飲んだけど…ぜんぜんきかねーじゃねーか!!
2006年09月07日
コメント(0)
3日ぶりに柔術の練習に復帰しました。でもでも痛くて動けません。ちょっと情けなくてみじめで泣けてきました…
2006年09月05日
コメント(0)
【西島洋介 vsエヴァンゲリスタ・サイボーグ 】 以前、前田日明が「K-1選手なら誰でも総合ができる」みたいなこといってたような記憶があるけど、ボクシング出身の人は苦労してるよね。 比べて寝技出身の人はそうでもないような。 ヤヒーラなんて強い強い。青木選手もそうだし。 それに、西島選手、もしかして心が優しすぎないか? 【ミルコvsシウバ】 前回の試合(PRIDE20)のときはきっちりきっちりハイをマークしてたシウバだったけど、今回それが出来なかったのは、 ミルコが進歩したからなんだろうか。 ハイの前のミドル2発が相当効果的だったのでは。【アントニオ・ホドリゴ・ノゲイラ vs ジョシュ・バーネット 】 なぜに二人は黒パンなんだろうか? なぜに青木選手のようにロングスパッツを履かないんだろうか? 「総合」って考えたときにロングスパッツにしない理由があるんだろうけど、それにしてもすべりまくってたよねー。 【セルゲイ・ハリトーノフ vsエメリヤーエンコ・アレキサンダー 】 アレキサンダーどんどん強くなっているような… 【イ・テヒョン vs ヒカルド・モラエス】 【中村和裕 vs 中尾・KISS・芳広】 スポンサーだろうとなんだろうと、 試合前にドンペン君踊らせてるやつに「PRIDEわかってねぇ」とは言われたくないもんだ。 【マウリシオ・ショーグン vs ザ・スネーク】 【ヒカルド・アローナ vsアリスター・オーフレイム 】 相変わらずえげつない。 それを置いておいても、最近人気のアローナ。 そんなにやつの試合面白いか?? 【GP決勝】 サミングという声が多いがそうは見えなかった。 サミングであろうとなかろうと、心が折れたから抗議せずタップしたってことかな。 しかし強かった…。
2006年09月03日
コメント(0)
準備運動しました。足回ししました。足蹴りしました。足けりできませんでした。腰が痛くて。今日の練習は足回しだけでした(泣)
2006年09月01日
コメント(0)
こここ腰が…また腰が…TKにばりばりシザース決められました。ぼろぼろです。
2006年08月31日
コメント(0)
背中になんかシール貼ってもらいました。そしたら今までで一番動けました。初めてスイープできました。スイープ記念日です。
2006年08月30日
コメント(0)
背中が痛くて痛くて、下になるとまったく動きませんでした。体重をかけられなくても乗っかられると辛くて辛くて…。Tま坂Kんちゃんが減量のため、エアコンを切っての練習でした。暑くて暑くて…。いー汗かきました。
2006年08月29日
コメント(0)
さて、みなさんは次の事柄についてどう思いますか?・最近のK-1・最近の格闘技興行・タイソンのPRIDE参戦いろんな情報を目にしたとき、それについて語られる意見について、「果たして、自分の元々持っていた意見か、それとも読んだ意見に同調もしくは反発しているだけか?」ということをよく考えます。いろんなBBSとか回りますが、書き込む前に、自分の元々の考えはどうなんだ、ということを一呼吸置いて確かめるようにしています。さてそれでは以下のサイトをご覧ください。http://www.fighting-spirit.jp/kakuda_diary.html角田信朗氏のサイトなんですが、わたしのなかでこの人ほど好きか嫌いか迷う人はいません。書いていることも納得いくことも呆れることも情けなくなることもいろいろです。自分の性格として、AorBをはっきりしたい性質でして、だから氏についてもはっきりしたいのですが、なかなか自分の中でバランスが取れません。少なくとも氏ではあるけど師ではない、と思っています。でも何か羨ましいというか、どうせならこのまま世間の声を気にせず、間違いにも気づかないまま、堂々としていて欲しいものです。自分もそれくらいオメデタく生きたいものです。
2006年08月28日
コメント(0)
柔術はじめました@柔術日記へようこそ!今回の大会、よかったですね。なかなか内容がありました。柔術始めたおかげで視点も変わってきました。青木選手のほかにも好試合続出でしたね。日沖、メレンデス、三崎…茨城TTはどうなんでしょうか?中途半端な相手でかわいそうな気がしました。石田選手の相手は強かったけど。ウェルターGPはインパクトの強い試合ばかりで、試合終了後ももっと盛り上げて欲しかった。メインとの兼ね合いか知りませんが、そのあたり演出ミスのような気がします。五味?初参戦の選手と対戦というのは疑問です。ほかの試合もそうですが、前回までとの、今後との流れとかつながりとか、そういうのが見えにくい気がします。1試合1試合はよかったと思います。演出、煽りV、カメラワークは開いた口が何とやらですが、それを大きな声で言うと話がややこしくなるので。ただ、PRIDEってそういうものも含めたエンターテイメントだと気づいたとき、今までと同じ金額を払って観戦することにためらいを感じてしまいます。
2006年08月27日
コメント(0)
有名なフォトリーディングこれだけは(だけじゃないけど)、なかなか身につかないです。右脳に入っている感じはすごくあるんですが、いわゆる「出力」が下手なんですよね。マスターして、インストラクターになりたいです。で、毎日練習できる施設を作りたいです。
2006年05月21日
コメント(0)
フォトリーディングで有名なラーニングソリューションが提供するジーニアスコード…映像イメージという意味では、これが一番でしょうか。集中してかなりトレーニングしたこともあって、すごく効果があるように思います。
2006年05月21日
コメント(0)
七田眞氏監修のビジュアルトレーナーこれかなり難しいというか、レベルが高いです。ただ、間違いなくわたしの「映像イメージ」力を上げてくれました。とっつきにくいけど効果大、ということだと思います。
2006年05月21日
コメント(0)
なにがすごいって、2歳で詩の暗唱とかさせられるのよ。高村光太郎「道程」だって。やってるうちに片言ながら言えるようになるんだこれが。すごいよね~。俺なんか二歳のときの記憶さえないのに。
2006年05月21日
コメント(0)
風水に興味のある方はぜひこの方の鑑定、セミナーを受けられるといいと思います。うちの家族もとてもお世話になっています。年齢が違うのでわたしから評価はできないのですが、風水に限らず「生き方」というものを考えさせてくださる希少な方です。気さくな方ですから、お気軽に質問されてもいいと思います。
2006年02月23日
コメント(2)
使ってみて、よくなかったら全額返金してくれるというのはよくわかる。とてもいいことだと思う。100円や200円のもんじゃないんだから、リスクが減るなら万々歳だ。もともと去年の10月くらいに、俺がそんなことを言った気がする。「よくなかったらお金返してくれる??」って。で、今になって、こんなサービスだわ。それも、初回購入者限定、だって。それじゃあ、うちには何のメリットもないじゃん。まあ、いまさら金返してもらおうとも、商品に苦情言おうとも思っちゃいないけどさ。全額返金保障の金時しょうが錠
2006年01月31日
コメント(1)
癌ねぇ…身内が癌なら、知り合いが癌なら、そして自分が…「いい方法知ってますよ」と声をかけてあげられるような方法って、誰しもひとつかふたつは知ってるやね(たぶん)でも、それを素直に聞けるほど余裕ないだろうし、一番厄介なのは、「知り合いが癌なんだけど何か知らない?」って類。その人が「そんな方法があったんだ!」と思ってくれても、当人は実行しない、うん、絶対しない。そんなこんなで実の弟を40代で失った人も見てるし。知り合いが何とかなんですが…、という人には、「ふーん大変ですね」としか言わないことにしている。自分の知識を安売りするつもりはない(お金は取らんけど)。ただ、ある意味、真剣に聞かんやつに、真剣に伝えるのはいやだ。癌でも花粉症でも「つらいんです」って聞かされれば、こっちだって辛いし、悲しくなる。癌でもなんでも(便秘でも)、真剣に聞く気がないやつは「辛いんです」って言ってくるな。迷惑じゃ。真剣に聞くなら言うてくりゃ、一生懸命お知らせします。癌なら先月もご自身で克服された方とお話してきたし、まさにその場に克服中の方もおいでだったし。真剣な相談なら真剣に答えます。
2006年01月26日
コメント(0)
全181件 (181件中 1-50件目)