T
Todd Huttenstine
Here is what I have... The part of the code with the ***s
is the part messing up. I keep getting "Object doesnt
support this property or method). and it highlights the
line " If Application.CountIf(.Range("z1:z26"), "Name")
Private Sub CommandButton1_Click()
' Example of using the GetAColor function
' This sub prompts for a color, then changes
' the color the selected cells
Dim UserColor As Long
If TypeName(Selection) <> "Range" Then
MsgBox "Select a range."
Exit Sub
End If
UserColor = GetAColor()
If UserColor <> False Then Selection.Interior.Color =
UserColor
Range("Z1").Select
With Range("Z1").Interior
If .ColorIndex <> Range("A2").Interior.ColorIndex
Then
Application.ScreenUpdating = False
Cells.Interior.ColorIndex = .ColorIndex
Range("areaProgram").Interior.ColorIndex = 2
Range("areastatsnames").Interior.ColorIndex = 6
End If
'**************************
If Application.CountIf(.Range("z1:z26"), "Name") > 0 Then
Range("area1").Interior.ColorIndex = .ColorIndex
Else
Range("area1").Interior.ColorIndex = 2
End If
'**************************
is the part messing up. I keep getting "Object doesnt
support this property or method). and it highlights the
line " If Application.CountIf(.Range("z1:z26"), "Name")
0 Then" How do I fix this?
Private Sub CommandButton1_Click()
' Example of using the GetAColor function
' This sub prompts for a color, then changes
' the color the selected cells
Dim UserColor As Long
If TypeName(Selection) <> "Range" Then
MsgBox "Select a range."
Exit Sub
End If
UserColor = GetAColor()
If UserColor <> False Then Selection.Interior.Color =
UserColor
Range("Z1").Select
With Range("Z1").Interior
If .ColorIndex <> Range("A2").Interior.ColorIndex
Then
Application.ScreenUpdating = False
Cells.Interior.ColorIndex = .ColorIndex
Range("areaProgram").Interior.ColorIndex = 2
Range("areastatsnames").Interior.ColorIndex = 6
End If
'**************************
If Application.CountIf(.Range("z1:z26"), "Name") > 0 Then
Range("area1").Interior.ColorIndex = .ColorIndex
Else
Range("area1").Interior.ColorIndex = 2
End If
'**************************