我有一段执行特定功能的代码。 现在,我想在运行这段代码之前并在执行完此代码之后解锁工作表,我想使用密码锁定第1行和A,B,I,Q列。
For i = 2 To LastRowAT
If sht.Range("B" & i).Value = "BK" And sht.Range("D" & i).Value = "Allocated" And sht.Range("C" & i).Value = Max_date Then
If sht.Range("A" & i).Value = Workbooks("Co_insurer Sample File.xlsx").Worksheets("QUIDAM-INSURERS").Range("A" & i).Value Then
Workbooks("Co_insurer Sample File.xlsx").Worksheets("QUIDAM-INSURERS").Range("A" & i & ":V" & i).Copy _
Workbooks("Smart_Excel_BK.xlsm").Worksheets("Input").Range("Q" & (LastRowBK))
wsDest.Range("A" & LastRowBK).Value = "BK"
wsDest.Range("B" & LastRowBK).Value = Max_date
LastRowBK = LastRowBK + 1
End If
End If
Next i