Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Conditional Formatting to VBA code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dean P. - 18 Dec 2007 16:20 GMT
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)
Bob Phillips - 18 Dec 2007 17:03 GMT
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

Signature

---
HTH

Bob

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

> I have a conditional formatting applied to my worksheet (Seattle)
> within the spreadsheet.  I would like to drop the Excel conditional
[quoted text clipped - 16 lines]
> =AND(COUNTIF(Duplicate_R,C6)+COUNTIF(Duplicate_E,C6)>1,C6<>"")
> (Color Blue)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.