0

I have a cell in Excel formatted as percentage with 2 decimal places. I want to copy the cell's full value to a input field on an HTML page within a browser (e.g. Chrome).

When pasting into Excel, I can simply right-click and select values as the paste option. But how do I do this when pasting to other applications such as a browser?

For example, I click on the cell and press Ctrl-C. The cell shows 2.19% but the value is 0.02189112345. When I paste the value into the browser via Ctrl-V, it shows 2.19%. How can I get 0.02189112345?

2
  • Is it possible to change the value in Excel to Number format? Or want to keep the Percentage format and paste as Number format in browser?
    – Lee
    Commented Aug 5, 2021 at 7:11
  • I need to the keep the percentage format as-is in Excel.
    – James
    Commented Aug 5, 2021 at 16:21

3 Answers 3

0

Have you tried changing the format to number with 10 decimal places?

enter image description here

1
  • Thanks but I need to keep the format as percentage in Excel
    – James
    Commented Aug 5, 2021 at 16:22
0

You can use Conditional Formatting ("CF") to get over the hump.

The problem is that you need to keep the current formatting, but Excel only copies the DISPLAY value to the clipboard, not the full digits. CF can change the displayed value's format when you desire, but with the advantage of being a quick and easy thing to do.

Naturally, one could put a trigger value cell for the CF somewhere in the spreadsheet and change it to the trigger value when needed, then back after done with it. But I personally would prefer to use a Named Range to hold the value because it doesn't require space to be allowed for the cell and maybe a label for it plus it would not be apparent to users, usually..., if one did not wish them to be generally aware of it.

Any way you choose to set the value, do the following. I will use a Named Range called ChangeFormat which makes the change when its value is 1.

  1. Truck along doing normal work until you need the displayed values to be their full set of characters.

  2. Bring up the Named Range dialog box however you prefer. Ctrl-F3 works nicely.

  3. Edit the value in ChangeFormat's "Refers to:" box to 1.

  4. Save the change and return to the spreadsheet.

  5. Create a new CF rule for the cells you need to affect using a formula for controlling it.

  6. Use this formula:

    =ChangeFormat=1

  7. Set the formatting: Number format, General.

  8. Save the CF rule.

  9. Return to the spreadsheet.

Notice the changed number formatting for the cells. You may now copy and paste into other programs (a webpage, say) and the full set of digits will appear.

When done, change the Named Range value to anything else and note the cells return to the desired format.

There are other ways to do this, but they are all harder and some can't work depending upon with what the cells are filled. For example, if they have formulas producing their displayed values, one can do something analogous to the above, just in the formula itself. That complicates the formula, but works. Except... what if these are data cells, filled in by hand, copy and paste, or some other way? Then there's no formula to work with.

One could even use VBA to do this. But why? A very simple CF does the trick. If it's a LARGE amount of cells affected, at some point the load added by CF would slow things up and so VBA would win the day. But then, if you're extracting bits and bobs by hand, it doesn't seem like it would be enough to bog anything down.

0

use the Text funcion for Percentage, maybe an Adjacent Cell pulls the Numbers and converts them into true Percentage values, and you copy those cells into your cite!

I was just looking for this same solution and figured out a way to make it work for me!

  • =TEXT(YOUR_PERCENTAGE,"0.0%")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .