tuanphong76
Thành viên mới

- Tham gia
- 12/10/09
- Bài viết
- 15
- Được thích
- 0
bạn thử cái này. xem thế nào.Xin mọi người ai biết kẻ khung tự động xin chỉ giúp. Thank!
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
For Each rng In ActiveSheet.Range("b8", [b65536].End(xlUp))
If rng.Value = "" Then
Else
rng.BorderAround LineStyle:=xlContinuous, ColorIndex:=3, Weight:=xlThick
End If
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
For Each rng In ActiveSheet.Range("b2", [b65536].End(xldown))
If If rng.Value <> "" Then
rng.BorderAround LineStyle:=xlContinuous, ColorIndex:=3, Weight:=xlThick
End If
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
For Each rng In ActiveSheet.Range("b8.b100")
If rng.Value <> "" Then
For i = -1 To 2
Range(rng, rng.Offset(, i)).BorderAround LineStyle:=xlContinuous, ColorIndex:=3, Weight:=xlThick
Next i
End If
Next
End Sub
For Each rng In ActiveSheet.Range("b2", [b65536].End(xldown))
For i = -1 To 4
Range(rng, rng.Offset(, i)).BorderAround LineStyle:=xlContinuous, ColorIndex:=3, Weight:=xlThick
Next i
If Target.Column = 2 And Target.Row >= 7 And Target.Row <= 100 Then
If Not Intersect(Target, Range("B8:B100")) Is Nothing Then
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B3:B100")) Is Nothing And Target <> "" Then
Rw = Target.Row
For i = 1 To 4
Cells(Rw, i).BorderAround LineStyle:=xlContinuous, ColorIndex:=1, Weight:=xlThin
Next
End If
End Sub