Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I am trying to put a conditional format to format a cell plus the
adjacent cell immediately to the right with a heavy black border round the two cells. I have tried the code below but I get an error message "Appplication defined or Object defined error". The code ran previously but it did not reference the cell or apply the border format. I' ve ran out of ideas so any help would be apprecieated. Davie Sub Borders() ' Cells.Select Range("A12").Activate Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=$B$66" With Selection.FormatConditions(1).Borders Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional format of adjacent cell with different range and crite | New Users to Excel | |||
Inputting cell value from source cell based on value in adjacent cell. | Excel Discussion (Misc queries) | |||
change current cell colour based on the value of adjacent cell on other worksheet | Excel Programming | |||
Format cell based on adjacent cells values | Excel Programming | |||
I want to format a cell based on an adjacent cells value | Excel Discussion (Misc queries) |