0
១ ចូលទៅនកាន់ VBA (Alt + F11)
២ ជ្រើសរើស Sheet ដែលត្រូវលាក់ Row
៣ សូមជ្រើសរើស Event Change
៤ សរសេរកូដដូចតទៅ៖
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim rngMerge As Range, Cell As Range
Set rngMerge = Range("B12:B32")
On Error Resume Next
MergeAgain:
For Each Cell In rngMerge
If Cell.Value = Cell.Offset(1, 0).Value And IsEmpty(Cell) = False Then
Range(Cell, Cell.Offset(1, 0)).Merge
GoTo MergeAgain
End If
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

Post a Comment

Emoticon
:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top