Hello to the board!
Anyone can say what in this code is wrong, please?
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Protect userinterfaceonly:=True, Password:="", AllowSorting:=True, AllowFiltering:=True, AllowFormattingColumns:=True
If Intersect(Target, Range("E5:E300,M5:M100,D5:T300")) Is Nothing Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
Application.Calculation = xlManual
If Target.Column = 5 Then
Dim i As Long
Range("D5:D300").ClearContents
For i = 5 To Cells(Rows.Count, 5).End(xlUp).Row
Cells(i, 4).FormulaR1C1 = "=IF(RC[1]="""","""",SUBTOTAL(3,R5C5:RC[1]))"
Next i
End If
If Target.Column = 11 Then
'Dim i As Long
Dim b As Integer
Dim c As Range
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For Each c In Range("K5:K300")
For b = 1 To Lastrow
If c.Value = Cells(b, 1).Value Then c.Value = Cells(b, 2).Value
Next
Next
End If
I take this when try to save: Excel Wrong Code - 2018-11-13_11-36-42.png
Thanks in advance!
Bookmarks