'非保護セルを選択するマクロ 'セル範囲を選択してUnlockedCellsSelectマクロを実行してください。 '単一セルを選択して実行すると、ワークシートの使用範囲(UsedRange) 'を対象にします。 'ただし、行または列全体に非保護の設定がしてある場合も、使用セル範囲 '以外は対象にしません。 Option Explicit Sub UnlockedCellsSelect() Const myTitle = "非保護セルの選択" Dim range1 As Range On Error GoTo err_1 If TypeName(Selection) <> "Range" Then MsgBox "セル範囲を選択して実行してください。", _ vbExclamation, myTitle Exit Sub End If If Selection.Cells.Count = 1 Then Set range1 = ActiveSheet.UsedRange Else Set range1 = Application.Intersect( _ ActiveSheet.UsedRange, Selection) If range1 Is Nothing Then MsgBox "該当するセルはありません。", vbExclamation, myTitle End If End If Set range1 = GetUnlockedCells(range1) If range1 Is Nothing Then MsgBox "該当するセルはありません。", vbExclamation, myTitle Else range1.Select End If Exit Sub err_1: MsgBox Error(Err) & " (" & Err & ")", vbExclamation, myTitle End Sub Function GetUnlockedCells(range1 As Range) As Range Dim range2 As Range, r As Range Set range2 = Nothing For Each r In range1.Cells If Not r.Locked Then If range2 Is Nothing Then Set range2 = r Else Set range2 = Application.Union(range2, r) End If End If Next Set GetUnlockedCells = range2 End Function