ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   re-calc (https://www.excelbanter.com/excel-programming/350076-re-calc.html)

John Carroll

re-calc
 
i need to do a recalculation any time the cursor moves up or down on a
speadsheet - can anyone help?

Executor

re-calc
 
Hi John,

You should create a event on the worksheet:

Option Explicit

Private lngLastRow As Long

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count = 1 Then
If Target.Row < lngLastRow Then
Calculate
lngLastRow = Target.Row
End If
End If
End Sub

Hoop this helps,

Executor.


John Carroll

re-calc
 
thanks very much - it works perfectly!

"Executor" wrote:

Hi John,

You should create a event on the worksheet:

Option Explicit

Private lngLastRow As Long

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count = 1 Then
If Target.Row < lngLastRow Then
Calculate
lngLastRow = Target.Row
End If
End If
End Sub

Hoop this helps,

Executor.




All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com