M
MiataDiablo
dumbest question that will be posted all day, but here goes anyway.
How do I change the following macro so that it only applies to one
column instead of two? I don't know how to properly modify
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)) to just one of
those columns. Deleting the second "range" gives me a run-time
error. Maybe I should be using something all together different
anyway. When the user enters a value into Column 14, I want the word
"Subfile" to appear in Column 15; however, if the user deletes the
text in Column 14, I want "Subfile" removed/deleted.
Any and all help is always appreciated.
Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 14 And Target.Value <> "" Then
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)).Value =
"Subfile"
End If
If Target.Column = 14 And Target.Value = "" Then
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)).Value = ""
End If
Application.EnableEvents = True
End Sub
How do I change the following macro so that it only applies to one
column instead of two? I don't know how to properly modify
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)) to just one of
those columns. Deleting the second "range" gives me a run-time
error. Maybe I should be using something all together different
anyway. When the user enters a value into Column 14, I want the word
"Subfile" to appear in Column 15; however, if the user deletes the
text in Column 14, I want "Subfile" removed/deleted.
Any and all help is always appreciated.
Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 14 And Target.Value <> "" Then
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)).Value =
"Subfile"
End If
If Target.Column = 14 And Target.Value = "" Then
Range(Cells(Target.Row, 15), Cells(Target.Row, 16)).Value = ""
End If
Application.EnableEvents = True
End Sub