Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Oct 12, 4:36 pm, Gary''s Student
wrote: You have only a very small error: Range("J2:J" & LastRow).NumberFormat = "#,##0.00_);[Red](#,##0.00)" Range("K2:K" & LastRow).NumberFormat = "#,##0.00_);[Red](#,##0.00)" this "fills out" the range. Make sure column G goes down far enough -- Gary''s Student - gsnu2007 "tbmarlie" wrote: 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- Hide quoted text - - Show quoted text - Thanks, Gary. That did the job. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code Date Format Depending on Computer format | Excel Discussion (Misc queries) | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
searching by number or code ina work book | Excel Discussion (Misc queries) | |||
code is not to work on sheet1 | New Users to Excel | |||
Format the Cell into a telephone number but using country code | Excel Discussion (Misc queries) |