PC Review


Reply
Thread Tools Rate Thread

Conditional formating Run-time error '5'

 
 
jonnybrovo815
Guest
Posts: n/a
 
      26th Oct 2009
I have been using this code for quite some time now > 1 year. All of a
sudden it stopped working and is giving me a "Run-time error '5' Invalid
procedure call or argument."

The code is was selecting a range of entered cells for column K starting at
row 9 and then selecting down to the last entered cell in that column. Can
anyone tell me why it is not working now when it was just a week ago?

It stops at the formula that is entered into the conditional formatting
formula 1.

Here is the code:

Sub DupsColK()
'
' DupsColK Macro
' '

'
Range("K9").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTIF($K:$K,$K9)>1,COUNTIF($K$9:$K9,$K9)=1)"
Selection.FormatConditions(1).Interior.ColorIndex = 4
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTIF($K:$K,$K9)>1,COUNTIF($K$9:$K9,$K9)>1)"
Selection.FormatConditions(2).Interior.ColorIndex = 19
End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Calculations and Conditional Formating kristy_6278 Microsoft Excel Worksheet Functions 1 10th Jun 2009 01:11 PM
Conditional Formating for Time Sheet Akash Microsoft Excel Programming 3 27th Jun 2007 01:55 PM
Conditional Formating - Time difference =?Utf-8?B?Um9tYW4=?= Microsoft Excel Misc 2 15th Feb 2007 09:23 AM
conditional formating to keep the #N/A error from being visible =?Utf-8?B?aXJ2aW5lNzk=?= Microsoft Excel Misc 5 9th Feb 2007 04:44 AM
Help with Conditional Formating Time jonhunt Microsoft Excel Worksheet Functions 3 13th Jul 2006 09:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:31 AM.