【发布时间】:2014-07-31 06:41:54
【问题描述】:
我想在 Excel 2013 中查看一个命名的单元格区域,如果这些单元格中的文本是白色的,那么我想将该单元格右侧的单元格中的文本颜色设置为白色.任何人都可以帮助这个可怜的vba编程新手吗?非常感激。祝你有美好的一天!
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("DateOut").Select
For Each Cell In Selection
If Cell.Font.ColorIndex = 2 Then
Cell.Offset(, 1).Font.ColorIndex = 2
End If
Next
End Sub
【问题讨论】:
-
This: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Range("DateOut").Select For Each cell in Selection If Cell.Font.ColorIndex = 2 Then Cell.Offset(, 1).Font .ColorIndex = 2 End If Next End Sub
-
使用此代码更新您的问题 - 在 cmets 中无法读取
-
抱歉,如何让它在 cmets @simoco 中显示代码