Hello everybody!
New forum user here who is also very new when it comes to coding in Excel. I have encountered an issue where I get Run-time error 13 when deleting or inserting multiple rows.
Basically, I want my code to add "-" in a few columns when "TF" is entered in column A. If "TF" is removed, the dashes should also disappear.
I tried using the code from this post with no luck: https://www.mrexcel.com/forum/excel...ror-13-type-mismatch-when-deleting-cells.html
My code:
Does anybody know what I'm doing wrong?
New forum user here who is also very new when it comes to coding in Excel. I have encountered an issue where I get Run-time error 13 when deleting or inserting multiple rows.
Basically, I want my code to add "-" in a few columns when "TF" is entered in column A. If "TF" is removed, the dashes should also disappear.
I tried using the code from this post with no luck: https://www.mrexcel.com/forum/excel...ror-13-type-mismatch-when-deleting-cells.html
My code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
If Target.Column = 1 And Target.Column Mod 2 >= 1 And Target.Row >= 3 Then
For Each c In Target
If c.Value = "TF" Then
c.Offset(0, 11).Value = "-"
c.Offset(0, 12).Value = "-"
c.Offset(0, 13).Value = "-"
c.Offset(0, 14).Value = "-"
Else
c.Offset(0, 11).Value = ""
c.Offset(0, 12).Value = ""
c.Offset(0, 13).Value = ""
c.Offset(0, 14).Value = ""
End If
Next c
End If
End Sub
Does anybody know what I'm doing wrong?