le anh hai
Thành viên mới
- Tham gia
- 19/4/08
- Bài viết
- 9
- Được thích
- 0
Option Explicit
Sub Ghep2So()
Dim Cls0 As Range, Cls1 As Range
Range([b3], [B999].End(xlUp)).ClearContents
For Each Cls0 In Range([A3], [a999].End(xlUp))
For Each Cls1 In Range(Cls0.Offset(1), [a999].End(xlUp))
If Cls1.Value <> Cls0.Value And Cls0.Address <> [a999].End(xlUp).Address Then
[B999].End(xlUp).Offset(1).Value = Cls0.Value & "-" & Cls1.Value
End If
Next Cls1
Next Cls0
End Sub
Sub Ghep3So()
Dim Cls0 As Range, Cls1 As Range, Cls2 As Range
Const GN As String = "-"
Range([c3], [c999].End(xlUp)).ClearContents
For Each Cls0 In Range([A3], [a999].End(xlUp))
For Each Cls1 In Range(Cls0.Offset(1), [a999].End(xlUp))
For Each Cls2 In Range(Cls1.Offset(1), [a999].End(xlUp))
If Cls0.Address <> [a999].End(xlUp).Address And Cls1.Address <> [a999].End(xlUp).Address Then
[c999].End(xlUp).Offset(1).Value = Cls0.Value & GN & Cls1.Value & GN & Cls2.Value
End If
Next Cls2, Cls1
Next Cls0
End Sub
Bạn up cho mình file hoàn chỉnh lên đi mình đang cần mà
Xin mời & theo mình bài này dùng công thức thì ê lắm!
Nó là [C1] í