I have a table where I use a macro to add a new row. A cell on that row selects its value from a list. I would like to be able to set the value of another cell on the same row with an If, then else. I've found pieces like the Worksheet_Change event but my code crashes excel:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rs As Worksheet
Set rs = ThisWorkbook.Worksheets("Resources")
If ActiveCell.Value = "DTS" Then
ActiveCell.Offset(0, 21).Value = rs.Range("J82")
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rs As Worksheet
Set rs = ThisWorkbook.Worksheets("Resources")
If ActiveCell.Value = "DTS" Then
ActiveCell.Offset(0, 21).Value = rs.Range("J82")
End If
End Sub