Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default 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)"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Number Format Changes During VBA Copy/Paste LarryP Excel Discussion (Misc queries) 2 March 3rd 10 03:21 PM
Replace million-billion number format to lakhs-crores format Sumit Excel Discussion (Misc queries) 1 December 9th 05 04:58 PM
Number format based on number format of another cell in another workbook Rob Excel Programming 9 January 9th 05 04:30 PM
How copy format, font, color and border without copy/paste? Michel[_3_] Excel Programming 1 November 5th 03 04:43 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"