Morning,
Just a quick question - I currently have macros running on a Worksheet Calculate function. Can I change the VBA so that it only runs the macro if the cell value goes up rather than if the cell value changes?
Thanks
Morning,
Just a quick question - I currently have macros running on a Worksheet Calculate function. Can I change the VBA so that it only runs the macro if the cell value goes up rather than if the cell value changes?
Thanks
Try entering the following in the appropriate worksheet module:
Be aware it will only work correctly for changes to single cells though, so selecting multiple cells and deleting / pasting / changing values will not work as intended.![]()
Dim tgtPrev As Variant Private Sub Worksheet_SelectionChange(ByVal Target As Range) tgtPrev = Target.Value End Sub Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub If Target.Value > tgtPrev Then ' Target value has increased - enter your code here End If tgtPrev = Target.Value End Sub
let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source
If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE
Walking the tightrope between genius and eejit...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks