Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query in excel to combine cells with Superscript and subscript by UDF or Macro 4

Status
Not open for further replies.

raviprakash369

Aerospace
Mar 25, 2015
49
Hi all,
Again came with some query as I tried a lot and not able to get the result.
Question is there are 3 cells in excel with inputs like 20 in 1st cell, +0.2 in 2nd cell, -0.1 in third cell. we need a Macro or UDF to get output in a single cell with 20 and +0.2 as superscript, -0.1 as subscript.
I have tried the below formula which can combine the 3 cells and not resulting with superscript and subscript.
=TEXT(CONCATENATE(O24,IF(P24>0,"+"&P24,"-"&P24),IF(Q24>0,""&Q24,"-"&Q24)),"@") where P24,Q24 and O24 are display cell numbers.
If anyone knows please help.
 
Replies continue below

Recommended for you

Once again, you need declarations...
Code:
'
    Dim p1 As Integer, p2 As Integer


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Ravi, there are all sorts of ways of implementing a concept. Your original question had noting to do with implementation. It was simply,
Ravi said:
Question is there are 3 cells in excel with inputs like 20 in 1st cell, +0.2 in 2nd cell, -0.1 in third cell. we need a Macro or UDF to get output in a single cell with 20 and +0.2 as superscript, -0.1 as subscript....where P24,Q24 and O24 are display cell numbers.

Then you posted...
Ravi said:
One more thing I found is : If value in any input cell is edited after running the macro, the result will be same as before. Associativity is not there after editing the input cells.

I replied...
SkipVought said:
You can "automatically" run this macro using the WorkSheet_Change Event.

Plz upload your workbook

Your feedback regarding how you need to use this macro has been virtually nonexistent.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor