你想隐藏单元格或行,如果你的选择是您可以使用此子读取所有的行到表中,如果二路映像名称和图像当前行的版本是以前的一些行成为当前行会被隐藏的
Sub HideDoubleRst()
Application.ScreenUpdating = False
Dim UR As Long, X As Long
Dim MyCol As Integer
MyCol = Range("A:A").Column
UR = Cells(Rows.Count, MyCol).End(xlUp).Row
For X = 2 To UR
If Cells(X, MyCol) = Cells(X - 1, MyCol) And Cells(X, MyCol + 1) = Cells(X - 1, MyCol + 1) Then
Rows(X).Select
Selection.EntireRow.Hidden = True
End If
Next X
Application.ScreenUpdating =真 结束小组 或者,如果你只想隐藏2个细胞您CA n改变背景颜色和你fontcolor到白色
Sub ColorDoubleRst()
Application.ScreenUpdating = False
Dim UR As Long, X As Long
Dim MyCol As Integer
MyCol = Range("A:A").Column
UR = Cells(Rows.Count, MyCol).End(xlUp).Row
For X = 2 To UR
If Cells(X, "A") = Cells(X - 1, "A") Then
Cells(X, "A").Select
With Selection.Font
.ThemeColor = xlThemeColorDark1
End With
With Selection.Interior
.ThemeColor = xlThemeColorDark1
End With
If Cells(X, "B") = Cells(X - 1, "B") Then
Cells(X, "B").Select
With Selection.Font
.ThemeColor = xlThemeColorDark1
End With
With Selection.Interior
.ThemeColor = xlThemeColorDark1
End With
If Cells(X, "F") = Cells(X - 1, "F") Then
Cells(X, "F").Select
With Selection.Font
.ThemeColor = xlThemeColorDark1
End With
With Selection.Interior
.ThemeColor = xlThemeColorDark1
End With
End If
End If
End If
Next X
Application.ScreenUpdating = True
End Sub
我想隐藏只是2个单元格。在A2中,我们有Image S400和B2 1.3。现在我只想在这种情况下隐藏单元格A3和B3,因为它们与上面相同。例如“图像名称”是图像S400,但“图像版本”是1.4例如,然后只隐藏单元格“图像名称” – Declade
@Declare,我添加子ColorDoubleRst,我认为你想 – Fabrizio
这个作品真棒,谢谢您。但是我得到了最后一个问题,如果我想添加另一列来检查那里,我会在那里做什么?例如NotebookName列F? – Declade