ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Number format won't copy (https://www.excelbanter.com/excel-programming/399260-number-format-wont-copy.html)

tbmarlie

Number format won't copy
 
I'm trying to format 2 columns of data into numeric format using the
code shown below, but its not working. There are blank cells in the
data; otherwise, I would do a select-down-format. The columns are J
and K. 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)"

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


Gary''s Student

Number format won't copy
 
See response in the other group
--
Gary''s Student - gsnu200749


"tbmarlie" wrote:

I'm trying to format 2 columns of data into numeric format using the
code shown below, but its not working. There are blank cells in the
data; otherwise, I would do a select-down-format. The columns are J
and K. 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)"

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



JW[_2_]

Number format won't copy
 
On Oct 12, 6:56 pm, tbmarlie wrote:
I'm trying to format 2 columns of data into numeric format using the
code shown below, but its not working. There are blank cells in the
data; otherwise, I would do a select-down-format. The columns are J
and K. 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)"

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


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


tbmarlie

Number format won't copy
 
On Oct 12, 4:40 pm, JW wrote:
On Oct 12, 6:56 pm, tbmarlie wrote:





I'm trying to format 2 columns of data into numeric format using the
code shown below, but its not working. There are blank cells in the
data; otherwise, I would do a select-down-format. The columns are J
and K. 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)"


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


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

- Show quoted text -


Thanks for both your help. That worked.



All times are GMT +1. The time now is 09:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com