# VBA Language to convert whole number to percentage

#### NinaE_11

##### New Member
Hi,
I'm setting values in one spreadsheet from another using the following code:

Workbooks("Template_VBA.xlsm").Worksheets("Char").Range("E11").Value = _
Workbooks("Characteristics.xlsx").Worksheets("Active").Range("B37").Value

The original value in B37 on the "Active" worksheet is a whole number of 29.3, which I need to reflect as 29.3% in the destination worksheet ("Char"). I have a whole page of these I need to convert over into these percentages for a presentation using the below code, however, whatever I'm doing is giving me a result of 2930%.

With Range("E11")
.Value = .Value / 100
.NumberFormat = "0.0%"
End With

Anything help would be great - thank you!

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

#### Joe4

It works just fine for me, if cell E11 is hard-coded and not a link/formula.
If it is a link/formula, you will need to update your formula to divide by 100.

Why not just do:
Rich (BB code):
``````Workbooks("Template_VBA.xlsm").Worksheets("Char").Range("E11").Value = _
Workbooks("Characteristics.xlsx").Worksheets("Active").Range("B37")/100``````
and then you can format the range.

#### NinaE_11

##### New Member
What exactly is in cell E11?
Is it hard-coded, or is it a formula?
If it is a formula, you will need to update your formula to divide by 100.
The number is cell E11 is hard-coded, downloaded from an external source.

#### Joe4

Sorry, you were too quick and replied while I was making edits to my previous post!
Take a look at the revised suggestion.

#### NinaE_11

##### New Member
Sorry, you were too quick and replied while I was making edits to my previous post!
Take a look at the revised suggestion.
Outstanding!! Thank you SO much!

#### Joe4

You are welcomne.

Replies
9
Views
85
Replies
5
Views
76
Replies
7
Views
140
Replies
3
Views
162
Replies
4
Views
149

1,127,444
Messages
5,624,809
Members
416,055
Latest member
EJGAJG

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back