NguyenNgocSon
KEEP WALKING
- Tham gia
- 4/4/08
- Bài viết
- 280
- Được thích
- 833
- Nghề nghiệp
- Ths. Cầu hầm
Private Sub CommandButton1_Click()
Dim i&
With UsedRange
For i = 4 To .Row + .Rows.Count - 1
If Cells(i, 1) <> vbNullString Then
If Cells(i, 1).Address = Cells(i, 1).MergeArea(1).Address Then
danhSTT i, i + Cells(i, 1).MergeArea.Rows.Count - 1
End If
End If
Next
End With
End Sub
Private Sub danhSTT(FirstRow&, LastRow&)
Dim i&, Dem&
For i = FirstRow To LastRow
If Cells(i, 4).Address = Cells(i, 4).MergeArea(1).Address Then
Dem = Dem + 1
Cells(i, 4) = Dem
End If
Next
End Sub