how to keep the same format

Tody03

New Member
Joined
Jun 21, 2014
Messages
48
I want to combine in one cell two numbers with different formats. How to maintain the percentage format

[TABLE="width: 671"]
<colgroup><col span="2"><col span="2"><col></colgroup><tbody>[TR]
[TD][TABLE="width: 724"]
<colgroup><col span="2"><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD="align: left"]Command[/TD]
[TD="align: left"]Result [/TD]
[TD="align: left"]Desired display [/TD]
[/TR]
[TR]
[TD]-6%[/TD]
[TD]80[/TD]
[TD="align: left"]=B2&" "&A2[/TD]
[TD="align: left"]80 -0.0584795321637427[/TD]
[TD="align: left"]80 -6%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD="align: left"][/TD]
[TD="align: left"][/TD]
[TD="align: left"][/TD]
[/TR]
</tbody>[/TABLE]

thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi, you can try:

=B2&" "&TEXT(A2,"0%")
 
Upvote 0
I need your help again.
i tried to install your code into my macro and i got errors. can you help me to correct the the syntax

Range("G2").Select
ActiveCell.FormulaR1C1 = "=Rc[-3]&"",""&text(Rc[-4],0%)&"",""
Thanks
 
Upvote 0
i tried to install your code into my macro and i got errors. can you help me to correct the the syntax

Hi, the easiest way to get the correct syntax for formulas is to record a macro whilst you manually enter it into the cell.

The recorder gives..

Code:
Range("G2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]&"" ""&TEXT(RC[-2],""0%"")"

Which can then be simplified to..
Code:
Range("G2").FormulaR1C1 = "=RC[-1]&"" ""&TEXT(RC[-2],""0%"")"
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top