Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50178

Step back not working when this code is in my sheet???

$
0
0
Hello Everyone,

I want to use the code below as it does exactly what I want it to do but the problem is that whenever there is a change
to the page the undo option does not work (using the undo icon)? is there any way to modify this code so
that undo will still be enabled? I am running it on Excel 2010.

Thank you in advance for any help.

Code as follows:
Code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i, LastRow, tSum
LastRow = Range("K" & Rows.Count).End(xlUp).Row
For i = 1 To LastRow
If Cells(i, "K").Interior.ColorIndex = 15 Then
tSum = tSum + Cells(i, "K").Value
End If
Next
Range("X37").Value = tSum
End Sub


Viewing all articles
Browse latest Browse all 50178

Trending Articles