PDA

View Full Version : Solved: Format cell when condition fulfilled



nitzbar
08-15-2008, 12:58 PM
How do i format a cell ( eg change font size, make it bold, change color etc) when it fulfils a certain condition ?

eg if d5 = max (a5,b5,c5,d5) then d5 should change colour, font etc

mdmackillop
08-15-2008, 01:33 PM
Conditional formatting
=A1=MAX($A1,$B1,$C1,$D1)

nitzbar
08-15-2008, 02:29 PM
Hi... Thanks for helping me out... i have attached my workbook to give a clearer picture

1. i would like to populate columns in the sheet 'results' from data in sheets 'calculations 1' .... to 'calculations9' , columns c,d,e.....s , with sample 1 being from 'calculations1' , 'sample 2 from 'calculations2' etc etc

2. Regarding the formatting, i would like columns g (best price bid) and h to change colour. become bold etc whenever the value in h is >0... the same for columns p and q

Would really appreciate any tips you could give me on how to get started. i'm a complete beginner.

Thanks:help

mdmackillop
08-15-2008, 03:33 PM
I've simplified things by adding the sheet names into Column 1

Option Base 1
Sub FillData()
Dim c, Cols, ColLet
Dim i As Long, j As Long
Application.Calculation = xlCalculationManual
Cols = Array(3, 4, 5, 6, 7, 12, 13, 14, 15, 16)
ColLet = Array("D", "I", "G", "K", "M", "E", "J", "H", "L", "N")
For i = 13 To 589 Step 72
j = 0
For Each c In Cols
j = j + 1
Cells(i, Cols(j)).Formula = "='" & Cells(i, 1) & "'!" & ColLet(j) & "13"
Cells(i, Cols(j)).Resize(69).FillDown
Next c
Next
Application.Calculation = xlCalculationAutomatic
End Sub

nitzbar
08-19-2008, 09:14 AM
thanks a lot... i really appreciate it.