Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default copying values

Suppose sheet1.A1 has value 0.00 displayed on worksheet. Hoewever, the value
"0" is stored in the formula box. When I execute the code below, it displays
"0" on sheet2.A1 instead of 0.00. How can I make this operation give me 0.00?

sheet2.cells(1,1).value = sheet1.cells(1,1).value
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default copying values

sheet2.cells(1,1).Copy destination:=sheet1.cells(1,1)
or
after your line put
sheet2.cells(1,1).numberformat=sheet1.cells(1,1).n umberformat

"tom" a écrit dans le message de news:
...
Suppose sheet1.A1 has value 0.00 displayed on worksheet. Hoewever, the
value
"0" is stored in the formula box. When I execute the code below, it
displays
"0" on sheet2.A1 instead of 0.00. How can I make this operation give me
0.00?

sheet2.cells(1,1).value = sheet1.cells(1,1).value



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default copying values

You need to set the number format something like this...

Sheet2.Cells(1, 1).Value = Sheet1.Cells(1, 1).Value
Sheet2.Cells(1, 1).NumberFormat = Sheet1.Cells(1, 1).NumberFormat

--
HTH...

Jim Thomlinson


"tom" wrote:

Suppose sheet1.A1 has value 0.00 displayed on worksheet. Hoewever, the value
"0" is stored in the formula box. When I execute the code below, it displays
"0" on sheet2.A1 instead of 0.00. How can I make this operation give me 0.00?

sheet2.cells(1,1).value = sheet1.cells(1,1).value

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default copying values

Add a second line of code like this:

sheet2.cells(1,1).value = sheet1.cells(1,1).value
sheet2.cells(1,1).NumberFormat = sheet1.cells(1,1).NumberFormat

--
Regards,
Tom Ogilvy



"tom" wrote:

Suppose sheet1.A1 has value 0.00 displayed on worksheet. Hoewever, the value
"0" is stored in the formula box. When I execute the code below, it displays
"0" on sheet2.A1 instead of 0.00. How can I make this operation give me 0.00?

sheet2.cells(1,1).value = sheet1.cells(1,1).value

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
Copying only the numerical values SM New Users to Excel 2 November 7th 07 11:21 PM
Copying Cell Values crabtrees Excel Discussion (Misc queries) 3 August 17th 06 09:11 PM
Copying Values to another Workbook Ren Excel Programming 3 July 27th 06 05:55 PM
Copying values from one file to another titushanke[_4_] Excel Programming 1 September 26th 05 04:09 PM
copying values david Excel Programming 2 September 4th 03 08:20 PM


All times are GMT +1. The time now is 04:03 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"