PC Review


Reply
Thread Tools Rate Thread

Conditional Formatting to VBA code

 
 
Dean P.
Guest
Posts: n/a
 
      18th Dec 2007


I have a conditional formatting applied to my worksheet (Seattle)
within the spreadsheet. I would like to drop the Excel conditional
formatting and create a Excel VBA button that would apply the same
validations as the condtional formatting.

Listed below are two validations that only correspond to row 6 in the
worksheet (Seattle).

The button with the VBA code should include all rows for the worksheet.

Please help me with the code to complete this task.

Thanks,

Column C is Created with the following format
(=IF(OR(A6<>"",B6<>""),CONCATENATE(A6,"-",B6),""))

(Conditional 1)
=AND(COUNTIF(Duplicate_R,C6)+COUNTIF(Duplicate_E,C6)>1,C6<>"")
(Color Blue)

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      18th Dec 2007

For i = 2 To Cells(Rows.Count,"C").End(xlUp).Row
If Application.Countif(Range("Duplicate R", Cells(i,"C").Value + _
Application.Countif(Range("Duplicate E", Cells(i,"C").Value > 1 And
_
Cells(i, "C").Value <> "" then
Cells(i, "C").Interior.Colorindex = 5
End If
Next i

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Dean P." <Dean P.@discussions.microsoft.com> wrote in message
news:BE3A968E-78B6-4904-AFEF-(E-Mail Removed)...
>
>
> I have a conditional formatting applied to my worksheet (Seattle)
> within the spreadsheet. I would like to drop the Excel conditional
> formatting and create a Excel VBA button that would apply the same
> validations as the condtional formatting.
>
> Listed below are two validations that only correspond to row 6 in the
> worksheet (Seattle).
>
> The button with the VBA code should include all rows for the worksheet.
>
> Please help me with the code to complete this task.
>
> Thanks,
>
> Column C is Created with the following format
> (=IF(OR(A6<>"",B6<>""),CONCATENATE(A6,"-",B6),""))
>
> (Conditional 1)
> =AND(COUNTIF(Duplicate_R,C6)+COUNTIF(Duplicate_E,C6)>1,C6<>"")
> (Color Blue)
>



 
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
Conditional Formatting -- Need VBA Code Kim M. Microsoft Access VBA Modules 1 15th Mar 2010 08:53 PM
Conditional Formatting via Code ant1983 Microsoft Access VBA Modules 6 19th Jan 2010 06:54 PM
Code for conditional formatting =?Utf-8?B?Q2FsZWRvbmlh?= Microsoft Access Form Coding 13 1st Mar 2007 12:03 AM
Code for conditional formatting =?Utf-8?B?cm9uIGI=?= Microsoft Access 5 20th Jan 2007 09:16 AM
Code to do conditional formatting sc888ter Microsoft Access Form Coding 1 26th Mar 2005 05:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:54 PM.