cell reference within text (decimal place)

beelzebubble

Board Regular
Joined
Jun 11, 2009
Messages
68
Hi,

This should be easy, but I can't seem to figure it out. I simply want to set the decimal place to 0 for a cell reference (which contains a numerical value based on a formulated calculation) within a block of text. Specifically, I've got the command below within cell F14.


="The percentage of people who said 'Yes' is equal to "&B15&"%."


It works fine, except that the cell reference value has way too many decimal places. That is, it produces the following:


The percentage of people who said 'Yes' is equal to 21.754152254656%.


I want it to produce:

The percentage of people who said 'Yes' is equal to 22%.


Thanks for any help
 
L

Legacy 68668

Guest
="The percentage of people who said 'Yes' is equal to "&Round(B15,0)&"%."
?
 

T. Valko

Well-known Member
Joined
May 9, 2009
Messages
16,623
Is B15 formatted as Percentage?

Here's another one:

="The percentage of people who said 'Yes' is equal to "&TEXT(B15,"0%")
 

beelzebubble

Board Regular
Joined
Jun 11, 2009
Messages
68
Curiously, when I run the formula as a macro:

Code:
Range("Sheet4!F14") = "=The percentage of people who said Yes is " & Round(B14, 0) & "%."
it produces an error.

If I try

Code:
Range("Sheet4!F14") = "The percentage of people who said Yes is " & Round(B14, 0) & "%."
It produces:

'The percentage of people who said Yes is 0%?'

Is there something 'special' that must be specified when the text is a combination of text and cell reference/formula? I've tried Range("Sheet4!F14").Formula, but that didn't work, amongst other things.

Any ideas?
 
Last edited:
L

Legacy 68668

Guest
try
Code:
Range("Sheet4!F14").Formula = _
"=""The percentage of people who said Yes is""&Round(B14, 0)&""%.""
 

Forum statistics

Threads
1,082,323
Messages
5,364,580
Members
400,809
Latest member
formulasataglance

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top