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
ADVERTISEMENT
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
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:
Hope that helps and post back with any questions or comments.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