Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
CJ CJ is offline
external usenet poster
 
Posts: 102
Default Concatenate cells containing exponents

Using Excel 2003, is it possible to concatenate cells containing exponents
without getting the carat? I don't want to concatenate 2 and the exponent 5
and get the result 2^5 when the 5 is already a superscript. The 5 needs to
remain as a superscript. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Concatenate cells containing exponents

Formulas don't allow this type of character by character formatting.

CJ wrote:

Using Excel 2003, is it possible to concatenate cells containing exponents
without getting the carat? I don't want to concatenate 2 and the exponent 5
and get the result 2^5 when the 5 is already a superscript. The 5 needs to
remain as a superscript. Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
CJ CJ is offline
external usenet poster
 
Posts: 102
Default Concatenate cells containing exponents

From my original post: is it possible to use VBA to write the base with the
exponent so that there is no carat? How would I do this? I want to display an
equation but the exponent will change. Any ideas please. Thank you.

"Dave Peterson" wrote:

Formulas don't allow this type of character by character formatting.

CJ wrote:

Using Excel 2003, is it possible to concatenate cells containing exponents
without getting the carat? I don't want to concatenate 2 and the exponent 5
and get the result 2^5 when the 5 is already a superscript. The 5 needs to
remain as a superscript. Thanks.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Concatenate cells containing exponents

I think we need some more information. You say superscript and caret when
referring to the value in a cell... exactly what value is in the cells and
how are you concatenating them?

--
Rick (MVP - Excel)


"CJ" wrote in message
...
From my original post: is it possible to use VBA to write the base with
the
exponent so that there is no carat? How would I do this? I want to display
an
equation but the exponent will change. Any ideas please. Thank you.

"Dave Peterson" wrote:

Formulas don't allow this type of character by character formatting.

CJ wrote:

Using Excel 2003, is it possible to concatenate cells containing
exponents
without getting the carat? I don't want to concatenate 2 and the
exponent 5
and get the result 2^5 when the 5 is already a superscript. The 5 needs
to
remain as a superscript. Thanks.


--

Dave Peterson


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Concatenate cells containing exponents

Just as a clarification on my last post... what I am asking for is an
example for two cells showing the values in them and the concatenated value
you want to produce from them. I'm specifically interested in seeing an
example of when the exponents are different from each other (if that is a
case that can in fact exist in your worksheet).

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
I think we need some more information. You say superscript and caret when
referring to the value in a cell... exactly what value is in the cells and
how are you concatenating them?

--
Rick (MVP - Excel)


"CJ" wrote in message
...
From my original post: is it possible to use VBA to write the base with
the
exponent so that there is no carat? How would I do this? I want to
display an
equation but the exponent will change. Any ideas please. Thank you.

"Dave Peterson" wrote:

Formulas don't allow this type of character by character formatting.

CJ wrote:

Using Excel 2003, is it possible to concatenate cells containing
exponents
without getting the carat? I don't want to concatenate 2 and the
exponent 5
and get the result 2^5 when the 5 is already a superscript. The 5
needs to
remain as a superscript. Thanks.

--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Concatenate cells containing exponents

If the value is text--not a real number, you can record a macro while you
superscript the characters you want.

If your values are digits, then you'll have to preformat the cell as text first
or start the entry with a leading apostrophe.

You could do the data entry using the caret (2^3) which will treat the entry as
text and then use an event macro that applies the superscript to everything
after the caret.

If you want to try...

Rightclick on the worksheet tab that should have this behavior. Select view
code. Paste this into the newly opened code window:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim RngToWatch As Range
Dim myIntersect As Range
Dim myCell As Range
Dim CaretPos As Long

Set RngToWatch = Me.Range("a:a")

Set myIntersect = Intersect(Target, RngToWatch)

If myIntersect Is Nothing Then
Exit Sub
End If

For Each myCell In myIntersect.Cells
With myCell
CaretPos = InStr(1, .Value, "^", vbTextCompare)
If CaretPos = 0 Then
'do nothing
Else
Application.EnableEvents = False
.NumberFormat = "@"
.Value = Replace(.Value, "^", "")
With .Characters(Start:=CaretPos, _
Length:=Len(Target.Value)).Font
.Superscript = True
End With
Application.EnableEvents = True
End If
End With
Next myCell

End Sub

I checked column A. You may want to use a specific address ("C3:d99")???

If you ever have to superscript/subscript lots of different characters, you may
want to try John Walkenbach's addin:

http://spreadsheetpage.com/index.php...atting_add_in/

Or even get John's Pup Utilities:
http://spreadsheetpage.com/index.php/pupv6/utilities/



CJ wrote:

From my original post: is it possible to use VBA to write the base with the
exponent so that there is no carat? How would I do this? I want to display an
equation but the exponent will change. Any ideas please. Thank you.

"Dave Peterson" wrote:

Formulas don't allow this type of character by character formatting.

CJ wrote:

Using Excel 2003, is it possible to concatenate cells containing exponents
without getting the carat? I don't want to concatenate 2 and the exponent 5
and get the result 2^5 when the 5 is already a superscript. The 5 needs to
remain as a superscript. Thanks.


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I show exponents in numerical form Tanjia Excel Discussion (Misc queries) 2 April 11th 07 12:08 AM
exponents in excel Pé Excel Worksheet Functions 0 February 15th 07 03:43 PM
exponents in excel Joel Excel Worksheet Functions 0 February 15th 07 02:45 PM
Superscripted exponents hmm Excel Discussion (Misc queries) 2 December 15th 06 09:09 AM
sum of a series of exponents sirsoto Excel Worksheet Functions 2 July 5th 05 08:57 PM


All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"