PDA

View Full Version : Conditional Format



ETracker
11-25-2006, 08:57 PM
Hi everyone,

I am trying to Conditional format a sheet, sheet1, in a workbook using VBA with two different formats when the workbook is opened.

The first column and line will be line A11 and the last column will be z. The last line will always be moving so I am looking for a way to have the code locate this row by using column K.

I need to know how to select this area using code, once I locate the area I will use this formulas below for the conditional format.

Condition #1 -- =$AA11>0.9999999 ----Shade Gray Columns A thru Z if condition is met

Condition #2 -- =$k11=0---------------Shade Gray Clumns A thru Z if condtion is met

This will allow the row to be gray if it is 100% done based on Column AA or if it is not used based on a zero in column K.

Any help would be great.

Thanks
ETracker :think: :dunno :think:

austenr
11-25-2006, 11:22 PM
Use a named range for the two ranges, then in the Workbook Open event, put a test for the conditions you want.

Ex:

Private Sub Workbook_Open()
Sheets("Sheet1").Activate
Your code here
End Sub

Bob Phillips
11-26-2006, 04:56 AM
The first column and line will be line A11 and the last column will be z. The last line will always be moving so I am looking for a way to have the code locate this row by using column K.




iLastRow = Cells(Rows.Count,"K").End(xlUp).Row
Set myRange = Range("A11").Resize(iLastRow - 10, 265)

ETracker
11-26-2006, 06:32 PM
Thanks for the reply austenr and xld.

I will give these a try and let you know how it goes.

Again, Thanks a lot.

ETracker