vzachin
01-27-2010, 07:26 AM
hi,
i'm running into an issue with the following code
Sub test()
With Sheets("total")
Set c = .Range("H6", .Range("H" & Rows.Count).End(xlUp))
End With
Sheets.Add.Name = "A"
c.Copy Sheets("A").Range("h6")
With Sheets("A")
.Columns("H:H").FormatConditions.Delete
Set c = .Range("H1", .Range("H" & Rows.Count).End(xlUp))
c.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($H$1:H1,H1)>1"
c.FormatConditions(1).Interior.ColorIndex = 35
End With
End Sub
when i check the Conditional Formatting in Sheets("A"), it shows as follows:
=COUNTIF($H$1:O6,O6)>1
it should be "=COUNTIF($H$1:H1,H1)>1
how can i correct this?
thanks
zach
i'm running into an issue with the following code
Sub test()
With Sheets("total")
Set c = .Range("H6", .Range("H" & Rows.Count).End(xlUp))
End With
Sheets.Add.Name = "A"
c.Copy Sheets("A").Range("h6")
With Sheets("A")
.Columns("H:H").FormatConditions.Delete
Set c = .Range("H1", .Range("H" & Rows.Count).End(xlUp))
c.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($H$1:H1,H1)>1"
c.FormatConditions(1).Interior.ColorIndex = 35
End With
End Sub
when i check the Conditional Formatting in Sheets("A"), it shows as follows:
=COUNTIF($H$1:O6,O6)>1
it should be "=COUNTIF($H$1:H1,H1)>1
how can i correct this?
thanks
zach