Navina Gawade
New Member
- Joined
- May 15, 2023
- Messages
- 4
- Office Version
- 2019
- Platform
- Windows
As I'm new to VBA I have tried following code which is working perfectly unless and until I delete some content in multiple cells of column B simultaneously.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
If Target.Value = "Shares" Then
Target.Offset(0, 1).Value = "Equity"
End If
End If
End Sub
(I used this code so that whenever I'll enter Shares in column B automatically equity will be popup in column C and whenever I'll type something other than shares column C will remain as it is. )
Can someone help me with code which will not result in such error as I'm totally unaware of VBA working.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
If Target.Value = "Shares" Then
Target.Offset(0, 1).Value = "Equity"
End If
End If
End Sub
(I used this code so that whenever I'll enter Shares in column B automatically equity will be popup in column C and whenever I'll type something other than shares column C will remain as it is. )