Dear anh với code này thì công thức goc trong cell là gì vậy anhEm đã từng thử thế này nhưng không ăn thua
Phải chữa cháy thế nàyPHP:Function SumVisible(rng As Range, Optional dk As Boolean = True) As Double Application.Volatile Dim it, kqduong, kqam For Each it In rng If it.Columns.Hidden = False Then If it > 0 Then kqduong = kqduong + it Else kqam = kqam + it End If Next If dk = True Then SumVisible = kqduong Else SumVisible = kqam End Function
PHP:Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.CalculateFull End Sub