View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
tbmarlie tbmarlie is offline
external usenet poster
 
Posts: 26
Default Number Format Code won't work

I have the following code to try to format two columns of numbers into
numeric format, but it doesn't want to work. There are blanks within
the 2 columns; otherwise I would just do a selec-end-down. Thanks.

Dim LastRow As Long
LastRow = Cells(Rows.Count, "G").End(xlUp).Row
Range("J2" & LastRow).NumberFormat = "#,##0.00_);[Red](#,##0.00)"
Range("K2" & LastRow).NumberFormat = "#,##0.00_);[Red](#,##0.00)"

Here's my sample data:

Column J Column K
Adjustment YTD Changes
6,550.63
6,550.63
1,984.62
1,984.62
-10,408.46
-10,408.46
13,350.04
13,350.04
4,118.37
4,118.37
-3,213.00
31.5
-6