Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Conditional formatting ranges in VBA

i am trying to CONDITIONAL FORMAT RANGE OF CELLS BASED ON ANOTHER RANGE OF CELLS I.E IF THEY MATCH (CELL FOR CELL) no format if one cell different to its counterpart formatting applied

I have achieved this in office 2007's excel which works as i want however the pc this program is destined for runs on excel 2003 so the conditional formatting doesn't work

so im looking to create vba code for it but cant get my head around converting the working formula into code

NOT (E8:R31=E54:R77) SETS OFF A CELL FILL

thanks in advance to anyone who can help out

Last edited by smokey4smokey : February 24th 11 at 03:57 PM
  #2   Report Post  
Member
 
Posts: 31
Default

Quote:
Originally Posted by smokey4smokey View Post
i am trying to CONDITIONAL FORMAT RANGE OF CELLS BASED ON ANOTHER RANGE OF CELLS I.E IF THEY MATCH (CELL FOR CELL) no format if one cell different to its counterpart formatting applied

I have achieved this in office 2007's excel which works as i want however the pc this program is destined for runs on excel 2003 so the conditional formatting doesn't work

so im looking to create vba code for it but cant get my head around converting the working formula into code

NOT (E8:R31=E54:R77) SETS OFF A CELL FILL

thanks in advance to anyone who can help out
From memory (of Excel 2003 and below) if you put the Conditional Format in the first cell and use the Format Painter on all subsequent cells it sould work.

Try the Conditional Format:
=IF(E8<E54,1,0)
...and format accordingly

NB: You may have to re-edit the Conditional Format formula to remove any $ automatically put in there by Excel - e.g. change "=IF($E$8<$E$54,1,0)" to read as above.

When you use the format painter on cells E8 thru to R31, it should increment the E8 and E54 in the Conditional Format formula for each cell individually (I think).

NB2: If you do this in Excel 2007, it will just apply the same Conditional Format across the range you selected - gives the same result in Excel 2007, but may not translate back to 2003 properly.
  #3   Report Post  
Banned
 
Location: Spain
Posts: 4
Send a message via ICQ to UniseeGed
Default

Hi,

To do this, create a new workbook and enter this into the workbook section in the vb editor:

Code:
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting & Protected Ranges disappear after running macro CNP Excel Discussion (Misc queries) 1 December 1st 10 10:09 PM
Conditional Formatting, Date Ranges and Rows chickalina Excel Discussion (Misc queries) 2 June 2nd 10 09:54 PM
Conditional formatting date ranges arkmpr Excel Worksheet Functions 1 January 19th 07 08:24 PM
Conditional Formatting - date ranges Angela Excel Discussion (Misc queries) 3 November 2nd 05 03:36 PM
Ranges within Conditional Formatting Ryno Excel Discussion (Misc queries) 4 December 14th 04 12:47 AM


All times are GMT +1. The time now is 11:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"