I have integrated the 2 codes but now I'm getting compile error 1004:
auto fill method failed
on line
.AutoFill .Resize(Range("c" & Rows.Count).End(xlUp).Row - .Row + 1), 2
If I delete the entire column 'C' then this error occurs.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
If Not Intersect(Target, Range("C:C")) Is Nothing Then
For Each cell In Intersect(Target, Range("C:C"))
If cell.Value = "" Then Range("B" & cell.Row).ClearContents
With Range("B6")
.Value = "1"
.AutoFill .Resize(Range("c" & Rows.Count).End(xlUp).Row - .Row + 1), 2
End With
Next cell
End If
MsgBox "Done!", 64
End Sub
Thanking you.
Bookmarks