Not sure if the title is fully clear on what im asking for as i am new to using VBA in excel but essentially I am looking to add in a date field to a cell in the same row but in a different column that is consistent. I feel like there is some way of seeing the selected cell in the range and writing to the specific column but im not sure how to go about it.
As an example:
This code I found is close to what I need but it requires me to manually enter the cell values which is very time consuming.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1
Then
ActiveSheet.Cells(7, 1).Value = Format(Date, "mm/dd/yyyy")
End If
End Sub
I need a way to make it work like a normal function does where it changes the cells used when you drag it. Is there a wildcard like character or a better way of calling this? I know its a bit hard to understand since I don't know the right terminology but any help would be greatly appreciated.
As an example:
Data Changed | XXXX | XXXX | XXXX | XXXX | XXXX | Date of Change |
Data Changed | XXXX | XXXX | XXXX | XXXX | XXXX | Date of Change |
This code I found is close to what I need but it requires me to manually enter the cell values which is very time consuming.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1
Then
ActiveSheet.Cells(7, 1).Value = Format(Date, "mm/dd/yyyy")
End If
End Sub
I need a way to make it work like a normal function does where it changes the cells used when you drag it. Is there a wildcard like character or a better way of calling this? I know its a bit hard to understand since I don't know the right terminology but any help would be greatly appreciated.