Can I Concatenate two cells and keep superscript?

jeebs83

Board Regular
Joined
May 12, 2009
Messages
97
Cell A1 = 10
Cell A2 = 3 (superscripted)

=CONCATENATE(A1,A2) renders 103, which is not what I'm looking for.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I am clueless when it comes to VBA, so yes, I would need to know what code is required and how to insert the code.

Thanks.
 
Upvote 0
I am leaving for the day now, but I will try to check from home tonight if I can, but someone else hopefully can come along and assist you.

This is a very quick try at it:

Code:
Sub test()
Range("A3").ClearContents
Range("A3").Value = Range("A1").Value & Range("A2").Value
For i = 1 To Len(Range("A1").Value)
    If Range("A1").Characters(i, 1).Font.Bold = True Then Range("A3").Characters(i, 1).Font.superscript = True
Next i
For j = 1 To Len(Range("A2").Value)
If Range("A2").Characters(j, 1).Font.superscript = True Then Range("A3").Characters(j + Len(Range("A1").Value), 1).Font.superscript = True
Next j
End Sub
Hope that helps, just put it in a standard module.

Make sure you make a backup of the workbook.
 
Upvote 0
Actually here is the code that will be used, but the cell needs to be formatted as text because if it is just numbers it keeps reverting back to just a general format with no superscript:

Code:
Sub test()
Range("A3").ClearContents
Range("A3").Value = Range("A1").Value & Range("A2").Value
For i = 1 To Len(Range("A1").Value)
    If Range("A1").Characters(i, 1).Font.Superscript = True Then Range("A3").Characters(i, 1).Font.Superscript = True
Next i
For j = 1 To Len(Range("A2").Value)
If Range("A2").Characters(j, 1).Font.Superscript = True Then Range("A3").Characters(j + Len(Range("A1").Value), 1).Font.Superscript = True
Next j
End Sub
Hope that helps and post back with any questions or comments.
 
Last edited:
Upvote 0
If you specifically want the cubed symbol, you can add that to A2 as a symbol (Insert-Symbol...) and then concatenate. Or use a custom number format.
 
Upvote 0
worked for me, thanks
but can i now how to extend the VBA option to other cells like, B, C, D and all the cells i need as you have given for a1, a2, a3
 
Upvote 0
Actually here is the code that will be used, but the cell needs to be formatted as text because if it is just numbers it keeps reverting back to just a general format with no superscript:

Code:
Sub test()
Range("A3").ClearContents
Range("A3").Value = Range("A1").Value & Range("A2").Value
For i = 1 To Len(Range("A1").Value)
    If Range("A1").Characters(i, 1).Font.Superscript = True Then Range("A3").Characters(i, 1).Font.Superscript = True
Next i
For j = 1 To Len(Range("A2").Value)
If Range("A2").Characters(j, 1).Font.Superscript = True Then Range("A3").Characters(j + Len(Range("A1").Value), 1).Font.Superscript = True
Next j
End Sub
Hope that helps and post back with any questions or comments.


thank you , worked for me
but how to extend the code to remaining cells , like b, c d
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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