PDA

View Full Version : macro to conditonal format and negative numbers



Pete
01-27-2010, 02:00 PM
Hi

Need a macro that will do the following steps for the following range of data:- Using column A

1. conditonal format any Zero (0) values in column J from J2 onwards until last cell - based on column A

2. range J2:AA last cell (based on column A) show all negative numbers i.e. -143.90 as (143.90) in red.

lucas
01-27-2010, 03:10 PM
I don't understand what "based on column A" means.

maybe a sample workbook with sample sheets, one before and one after.

Bob Phillips
01-27-2010, 03:20 PM
Dim i As Long
Dim LastRow As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("J2").Resize(LastRow - 1, 18).NumberFormat = "#,##0.00;[Red](#,##0.00)"
End With