Hi all,
Could anybody simply the following code with faster execution? Besides, how can I separate the last script "If Range("AH295") <> "" Then Update_Histogram" into another Sub without crashing the original one? many thanks
Private Const BecordToSheetName = "Tickers"
Sub Worksheet_Calculate()
Application.EnableEvents = False
With ThisWorkbook.Sheets(BecordToSheetName)
Dim r As Long
r = Application.WorksheetFunction.CountA(.columns(34)) + 1
If Range("M12") <> 0 Then
.Cells(r, 34).value = Range("M12").value
.Cells(r, 38).value = Range("Z12").value
.Cells(r, 35).value = Range("M31").value
.Cells(r, 36).value = Range("M10").value
.Cells(r, 37).value = Range("M83").value
Range("N12").value = Range("AF12").value
End If
End With
If Range("AH295") <> "" Then Update_Histogram
Application.EnableEvents = True
End Sub
Could anybody simply the following code with faster execution? Besides, how can I separate the last script "If Range("AH295") <> "" Then Update_Histogram" into another Sub without crashing the original one? many thanks
Private Const BecordToSheetName = "Tickers"
Sub Worksheet_Calculate()
Application.EnableEvents = False
With ThisWorkbook.Sheets(BecordToSheetName)
Dim r As Long
r = Application.WorksheetFunction.CountA(.columns(34)) + 1
If Range("M12") <> 0 Then
.Cells(r, 34).value = Range("M12").value
.Cells(r, 38).value = Range("Z12").value
.Cells(r, 35).value = Range("M31").value
.Cells(r, 36).value = Range("M10").value
.Cells(r, 37).value = Range("M83").value
Range("N12").value = Range("AF12").value
End If
End With
If Range("AH295") <> "" Then Update_Histogram
Application.EnableEvents = True
End Sub