LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Conditional Format - Doing without using .Select?

Currently I have a conditional format statement which uses select in
order to complete the cell CF.
The problem I have is that I have another macro which runs
automatically when Sheet1 is opened, thus in the below, I get an error
b/c the macro on Sheet1 runs.

Is there a way to CF without using .Select?

--------------------------------------

Sheets("Sheet1").Select
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue,
Operator:=xlGreater, Formula1:=XStanleyVariance + 0.008
Selection.FormatConditions(1).Font.ColorIndex = 3
Selection.FormatConditions.Add Type:=xlCellValue,
Operator:=xlLess, Formula1:=XStanleyVariance - 0.008
Selection.FormatConditions(2).Interior.ColorIndex = 33
Selection.FormatConditions.Add Type:=xlCellValue,
Operator:=xlBetween, Formula1:=XStanleyVariance - 0.008,
Formula2:=XStanleyVariance + 0.008
Selection.FormatConditions(3).Interior.ColorIndex = xlNone
Selection.FormatConditions(3).Font.ColorIndex = xlAutomatic
Sheets("X").Select

--------------------------------------

I tried the following, but it didn't work for some reason.


Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions.Delete
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater,
Formula1:=XStanleyVariance + 0.008
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions(1).Font.ColorIndex = 3
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions.Add Type:=xlCellValue, Operator:=xlLess,
Formula1:=XStanleyVariance - 0.008
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions(2).Interior.ColorIndex = 33
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween,
Formula1:=XStanleyVariance - 0.008, Formula2:=XStanleyVariance + 0.008
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions(3).Interior.ColorIndex = xlNone
Sheets("Sheet1").Cells(TemporaryRow + (RowTest - 1), ItemColumn +
2).FormatConditions(3).Font.ColorIndex = xlAutomatic


Any help appreciated, thankx. -np

 
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
New Conditional Format Overriding Previous Conditional Format Rene Excel Discussion (Misc queries) 3 February 27th 08 06:08 PM
Conditional Formatting - Can I select a select with Conditional Formatting? Greegan Excel Worksheet Functions 5 October 31st 05 02:19 PM
can not select conditional formatting gbeard Excel Worksheet Functions 2 April 10th 05 06:15 PM
Select Case Conditional Formatting Sub? RCW Excel Discussion (Misc queries) 2 February 5th 05 10:29 PM
When I select "format cells", the format dialog box does not disp. Andy S. Excel Worksheet Functions 2 November 23rd 04 03:49 AM


All times are GMT +1. The time now is 07:04 AM.

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

About Us

"It's about Microsoft Excel"