多列不相邻的单元格选取,在VBA中怎么样描述?比如下面的,那是选定的一个大区域,我想把它改成选C、F、K三列变化。就麻烦各位高手了,先谢谢了。 Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim myselect As Range cell = ActiveCell.Value Set myselect = Range("A1:IV101") myselect.FormatConditions.Delete myselect.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:=cell myselect.FormatConditions(1).Font.ColorIndex = 3 End Sub
[此贴子已经被作者于2009-11-12 18:09:37编辑过]
这样试一下,如果不行把要求写一下。 Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim myselect As Range cell = ActiveCell.Value Set myselect = Range("C1:C65536, F1:F65536,K1:K65536") myselect.FormatConditions.Delete myselect.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:=cell myselect.FormatConditions(1).Font.ColorIndex = 3 End Sub
|