I have an excel macro that is causing to typed content to change to default, so for example if I have entered something in italics, it would change it to normal once I press enter.
Can someone please let me know how I can change this macro to avoid this.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect ("")
If Target.Row > 4 And Target.Column = 7 Then
Application.EnableEvents = False
Target = Target & vbLf & " "
Application.EnableEvents = True
End If
If Target.Address = "$g$5" Then
Call AutofitRows
End If
ActiveSheet.Range("g5:g35000").WrapText = True
ActiveSheet.Protect (""), Contents:=True, Scenarios:=True, AllowFormattingRows:=True, AllowFiltering:=True, UserInterfaceOnly:=True, AllowFormattingCells:=True, AllowInsertingHyperlinks:=True, AllowSorting:=True
End Sub