Forum Discussion
Vishal88
Oct 16, 2022Copper Contributor
Copy Paste Not working after adding macro calculate function
I have a macro to create a function that gives the sum of values with particular cell color in a selected range of columns. For that macro to run whenever the cell color is changed in the range of co...
JKPieterse
Oct 17, 2022Silver Contributor
Vishal88 Change your code like this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.CutCopyMode = xlCopy Or Application.CutCopyMode = xlCut Then Exit Sub
If Not Intersect(Target, Range("G:K")) Is Nothing Then
ActiveSheet.Calculate
End If
End Sub