PDA

View Full Version : Excel Question



Peter Stahl
09-16-2011, 7:52 PM
Is there a way to copy data from a cell that has zero's after the decimal point? If I type in 65.000 then I copy it all I get in the clipboard is 65 not the decimal point or zero's. Is there a way to copy and get the zero's after the decimal point using a macro or function? I tried using the Round function in a macro but it didn't work. If I click the cell I typed 65.000 into then go to the formula bar all I see is 65 with no decimal point or zero's. Thanks for any help.

Doug Colombo
09-16-2011, 8:25 PM
Which version of Excel are you using ? I just tried a copy/paste of 65.000 and it transfered the complete number. I also did a copy from Excel and paste into Word and again it transfered corretly. I do see that the formula bar is only showing 65, but the numbers when pasted in the spreadsheet carry over the zeros. I am using Excel 2007.

Peter Stahl
09-16-2011, 8:29 PM
Which version of Excel are you using ? I just tried a copy/paste of 65.000 and it transfered the complete number. I also did a copy from Excel and paste into Word and again it transfered corretly. I do see that the formula bar is only showing 65, but the numbers when pasted in the spreadsheet carry over the zeros. I am using Excel 2007.

Probably the way the cell format is set. I'm using version 2003.

Doug Colombo
09-16-2011, 8:36 PM
Yes - if you change the cell format (right click the mouse) to number, 4 decimal places it should fix the issue.

Peter Stahl
09-16-2011, 8:53 PM
Yes - if you change the cell format (right click the mouse) to number, 4 decimal places it should fix the issue.

What I want is the full number with the decimal point and zero's in the clipboard when I do a copy, I don't have a problem with the way it looks in Excel. What I'm doing is copying the cell contents to the clipboard then pasting it into a word file. What you see ain't what you get.

Paul Cohen
09-16-2011, 9:11 PM
Try paste with source formating, it works for Office 2010.

Doug Colombo
09-16-2011, 9:21 PM
Try paste with source formating, it works for Office 2010.
It also works in 2007. When I copy / paste the number 65.0000 from Excel to Word, the defalt is source formating and it transfers correctly. But for this to work, you need to change the cell format in Excel to number, 4 decimal points.

Peter Stahl
09-16-2011, 9:28 PM
It also works in 2007. When I copy / paste the number 65.0000 from Excel to Word, the defalt is source formating and it transfers correctly. But for this to work, you need to change the cell format in Excel to number, 4 decimal points.

That's the way my Excel cells are formatted. Doing a cut/paste from excel to word works but when I get the values in a Macro I loose the zero's??? Below is what I use to get the number/value from a cell in my macro.

AcidMonRSText = Sheets(MainSheet).Range(AcidMonCellRange).Value

Doug Colombo
09-16-2011, 9:33 PM
That's the way my Excel cells are formatted.
I attached an Excel and Word file - is this what you are getting ?

Peter Stahl
09-16-2011, 9:48 PM
Doug,

I figured it out, I stumbled on it when I was looking up the source formatting stuff you posted above. What I had in my Macro was AcidMonRSText = Sheets(MainSheet).Range(AcidMonCellRange).Value and this gives actual value that Excel uses where when I changed it to AcidMonRSText = Sheets(MainSheet).Range(AcidMonCellRange).Text I got what is displayed on the screen like when you do a cut/paste. Thanks for the help, it got me thinking/searching in the right direction. Now I just need to remember to use the right one. Wish they sold memory for brains, lol. Thanks again.

Doug Colombo
09-17-2011, 7:08 AM
Glad to hear that you got it working ! Excel is great but can be a pain if you need to do something that you have not done for quite awhile - or does that fall into the memory issue of us operators - I have the same issue ... LOL .

Andrew Pitonyak
09-20-2011, 10:36 AM
Excel, well, I use it sometimes. My expertise is in OpenOffice.org or LibreOffice. That said, I have a few comments:

If your cells contain numbers and you copy them as text, then you will probably lose the ability to perform calculations on your data. If you require this ability, then do not simply copy the text, instead, be certain to copy both the data and the formatting.

Peter Stahl
09-20-2011, 4:15 PM
Excel, well, I use it sometimes. My expertise is in OpenOffice.org or LibreOffice. That said, I have a few comments:

If your cells contain numbers and you copy them as text, then you will probably lose the ability to perform calculations on your data. If you require this ability, then do not simply copy the text, instead, be certain to copy both the data and the formatting.

No I actually wanted text as it was being pasted into a Word file. This was for Workbooks and Documents that I use at work. Thanks for the reply.