|
楼主 |
发表于 2023-6-21 16:53
|
显示全部楼层
Dim messagecf As String
Dim tanchuang As Long
tanchuang = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To tanchuang
If Not IsEmpty(Range("A" & i).value) Then
应该是上面代码的问题,怎么修改成不跳过空白格, 来进行判断背景色
If Not IsEmpty(Range("E" & i).value) Then
If Range("E" & i).Interior.color = RGB(255, 255, 0) Then
UserForm1.ListBox1.AddItem ("班级名称E列第" & i & "行:“" & Range("E" & i).value & "”未能成功替换")
ElseIf Range("E" & i).Interior.color = RGB(0, 255, 255) Then
UserForm1.ListBox1.AddItem ("班级名称E列第" & i & "行:是空值")
End If
End If
|
|