Hello,
I’m having a problem triggering a macro after an “edit” entry has been made in a cell. I want to run the macro only if an edit has taken place. However, what appears to be happening is the macro is being triggered to soon (i.e., before the edit/entry is made). Is there a way to only run the code if an edit/Enter (or arrow) is made in the selected cell?
Here is a snippet of my code where I believe the problem exists (after the “If DoIt = vbYes Then” line):
Please bear with me as I have to note, I am not a programmer so this coding may appear to be incorrect, sloppy, or even a bit silly but for the most part it appears to be working.
Thanks for viewing,
Steve K.
I’m having a problem triggering a macro after an “edit” entry has been made in a cell. I want to run the macro only if an edit has taken place. However, what appears to be happening is the macro is being triggered to soon (i.e., before the edit/entry is made). Is there a way to only run the code if an edit/Enter (or arrow) is made in the selected cell?
Here is a snippet of my code where I believe the problem exists (after the “If DoIt = vbYes Then” line):
VBA Code:
If Not Intersect(Target, Range("M33:M2032")) Is Nothing Then
If ActiveCell.Offset(0, 0) > 0 And Sheets("Amortize").Rows(7).Hidden = True Then
Dim DoIt As Integer
DoIt = MsgBox(" - EDITING - " & vbNewLine & _
" Do you wish to edit Payment Date?", vbYesNo, " Edit Payment")
If DoIt = vbYes Then
MsgBox "Run Macro here" ‘ <----- This is what runs prior the edit
Else
SendKeys "{right}{left}" ‘ <----- Highlights DueDate
Range("M31").End(xlDown).Offset(1, 0).Select
End If
End If
End If
Please bear with me as I have to note, I am not a programmer so this coding may appear to be incorrect, sloppy, or even a bit silly but for the most part it appears to be working.
Thanks for viewing,
Steve K.