Bảy Dzõ
Ngu Excel nhất GPE
- Tham gia
- 18/11/09
- Bài viết
- 565
- Được thích
- 1,361
- Nghề nghiệp
- Just for daily's rice
Nhờ mọi người xem giúp mình bị lỗi chỗ nào mà nó cứ báo lỗi hoài... Mò hoài mà không biết nó bị ở đâu. Cám ơn
Nó báo lỗi ở hàng: If (shp.Name Like "*Rectangle*" Or shp.Name Like "*Flowchart*" Or shp.Name Like "*Freeform*") Then
Mã:
Sub CountColorsST() Dim sh As Shape
Dim i As Integer
Dim ws As Worksheet
Dim SS As Worksheet
Set ws = ThisWorkbook.Sheets("Sun-Thu")
Set SS = ThisWorkbook.Sheets("Settings")
ssLastRow = SS.Cells(SS.Rows.Count, "A").End(xlUp).Row - 1
For i = 2 To ssLastRow
SS.Cells(i, 2).Value = 0
Next i
For Each sh In Application.ActiveSheet.Shapes
If (shp.Name Like "*Rectangle*" Or shp.Name Like "*Flowchart*" Or shp.Name Like "*Freeform*") Then
For i = 2 To ssLastRow
If (sh.Fill.ForeColor = SS.Cells(i, 1).Interior.Color) Then
SS.Cells(i, 2).Value = SS.Cells(i, 2).Value + 1
End If
Next i
End If
Next
End Sub
Nó báo lỗi ở hàng: If (shp.Name Like "*Rectangle*" Or shp.Name Like "*Flowchart*" Or shp.Name Like "*Freeform*") Then