Hi Everyone,
I am new in learning VBA. I am trying to find a way to create code to perform the following function.
In tab OID, when the cell Submitted date is updated with a date & the Auto Refill = Y, then it will duplicate the record on an additional row with the due date updated by either a year, quarter or month, the frequency for that Report ID is located on the other tab RID.
I put code in the Worksheet SelctionChange; This is only a test code. I would want a code for the above logic.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Sets a variable to a proper range for later testing
Dim KeyCells As Range
Dim myColumn As ListObject
Set myColumn = ActiveSheet.ListObjects("tbl_OID")
Set KeyCells = myColumn.ListColumns(10).DataBodyRange
'Indentation is funky but it'd break when I'd mess with it.
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
'Section only triggers if within the designated range.
MsgBox "Change in cell " & Target.Address
End If
End Sub
Bookmarks