tpoynton, I have tried your suggestion, it doesn't work and I tried to change the variant type of range1.FormulaR1C1 & range2.FormulaR1C1 to string, the error still come up.
But I figured out another way to solve this issue.
Any way, thank you very much for your help!
Here is the code below:

[VBA]
Private Sub Worksheet_Change(ByVal Target As Range)
Call InputLimit
End Sub

Sub InputLimit()
Dim range1 As Range
Dim Sh As Worksheet
Set Sh = Workbooks("InputLimit").Worksheets("sheet1")
For Each cell In Range("A1:F19")
If cell.FormulaR1C1 = "" Then
Sh.Unprotect
Range("A1:F19").Locked = False
End If
Next
For Each cell In Range("A1:C19")
If cell.FormulaR1C1 <> "" And Range("D1:F19").Locked = False Then
Range("D1:F19").Locked = True
Sh.Protect
End If
Next
For Each cell In Range("D1:F19")
If cell.FormulaR1C1 <> "" And Range("A1:C19").Locked = False Then
Range("A1:C19").Locked = True
Sh.Protect
End If
Next
End Sub
[/VBA]