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

CommandResult Desired display
-6%80=B2&" "&A280 -0.058479532163742780 -6%

<colgroup><col span="2"><col><col><col></colgroup><tbody>
</tbody>

<colgroup><col span="2"><col span="2"><col></colgroup><tbody>
</tbody>

thanks
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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,214,832
Messages
6,121,849
Members
449,051
Latest member
excelquestion515

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