BlakeVanderMeer
New Member
- Joined
- Jan 27, 2021
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hi everyone, New here and new to VBA macros. most of my manipulations are done in python before working with the excel sheets... anyways,
I am hoping we someone can help me with what is probably pretty simple. I have a spreadsheet with a list of names in column A, starting in A2 and will run infinitely. I am looking to have (D) added to the end of the name when a date is entered into column C. Column C will be empty until someone manually adds a date to that position.
Here is the current code I have, Though it causes a debug error and isn't working. Thanks for any help!
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
If Target <> "" Then
Cells(lngRow, "B") = Cells(lngRow, "A") & "-Removed"
Else
Range("A" & Target.Row) = ""
End If
End Sub
I am hoping we someone can help me with what is probably pretty simple. I have a spreadsheet with a list of names in column A, starting in A2 and will run infinitely. I am looking to have (D) added to the end of the name when a date is entered into column C. Column C will be empty until someone manually adds a date to that position.
Here is the current code I have, Though it causes a debug error and isn't working. Thanks for any help!
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
If Target <> "" Then
Cells(lngRow, "B") = Cells(lngRow, "A") & "-Removed"
Else
Range("A" & Target.Row) = ""
End If
End Sub