PC Review


Reply
Thread Tools Rate Thread

characters within a linked cell

 
 
ORLANDO V
Guest
Posts: n/a
 
      22nd Dec 2008
Is there a way to change the format of how individual characters appear in a
linked cell while maintaining the link?

For example my link: ='Front page'!N43
should equal: 4.6[2] where [2] equals a superscripted 2 colored blue.
(unable to dupe this here hence [2].)

Please let me know.
Thank you.

 
Reply With Quote
 
 
 
 
JE McGimpsey
Guest
Posts: n/a
 
      22nd Dec 2008
XL functions only return values to their calling cells, not formats.

You could, instead, use an event macro. Put this in your target (i.e.,
non Front Page) worksheet's code module:

Private Sub Worksheet_Calculate()
Dim rSource As Range
Dim rCharFont As Font
Dim i As Long

On Error GoTo ExitSub
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set rSource = Worksheets("Front Page").Range("N43")
With Range("A1") 'Change to suit
.NumberFormat = "@"
.Value = rSource.Text
For i = 1 To Len(.Text)
Set rCharFont = rSource.Characters(i, 1).Font
With .Characters(i, 1).Font
.Name = rCharFont.Name
.FontStyle = rCharFont.FontStyle
.Size = rCharFont.Size
.Color = rCharFont.Color
If rCharFont.Subscript Then .Subscript = True
If rCharFont.Superscript Then .Superscript = True
.Underline = rCharFont.Underline
.Shadow = rCharFont.Shadow
.OutlineFont = rCharFont.OutlineFont
.Strikethrough = rCharFont.Strikethrough
End With
Next i
End With
ExitSub:
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub



In article <72B77E2E-440D-4871-8049-(E-Mail Removed)>,
ORLANDO V <(E-Mail Removed)> wrote:

> Is there a way to change the format of how individual characters appear in a
> linked cell while maintaining the link?
>
> For example my link: ='Front page'!N43
> should equal: 4.6[2] where [2] equals a superscripted 2 colored blue.
> (unable to dupe this here hence [2].)
>
> Please let me know.
> Thank you.

 
Reply With Quote
 
ORLANDO V
Guest
Posts: n/a
 
      22nd Dec 2008
Thank you.

"JE McGimpsey" wrote:

> XL functions only return values to their calling cells, not formats.
>
> You could, instead, use an event macro. Put this in your target (i.e.,
> non Front Page) worksheet's code module:
>
> Private Sub Worksheet_Calculate()
> Dim rSource As Range
> Dim rCharFont As Font
> Dim i As Long
>
> On Error GoTo ExitSub
> With Application
> .ScreenUpdating = False
> .EnableEvents = False
> End With
> Set rSource = Worksheets("Front Page").Range("N43")
> With Range("A1") 'Change to suit
> .NumberFormat = "@"
> .Value = rSource.Text
> For i = 1 To Len(.Text)
> Set rCharFont = rSource.Characters(i, 1).Font
> With .Characters(i, 1).Font
> .Name = rCharFont.Name
> .FontStyle = rCharFont.FontStyle
> .Size = rCharFont.Size
> .Color = rCharFont.Color
> If rCharFont.Subscript Then .Subscript = True
> If rCharFont.Superscript Then .Superscript = True
> .Underline = rCharFont.Underline
> .Shadow = rCharFont.Shadow
> .OutlineFont = rCharFont.OutlineFont
> .Strikethrough = rCharFont.Strikethrough
> End With
> Next i
> End With
> ExitSub:
> With Application
> .EnableEvents = True
> .ScreenUpdating = True
> End With
> End Sub
>
>
>
> In article <72B77E2E-440D-4871-8049-(E-Mail Removed)>,
> ORLANDO V <(E-Mail Removed)> wrote:
>
> > Is there a way to change the format of how individual characters appear in a
> > linked cell while maintaining the link?
> >
> > For example my link: ='Front page'!N43
> > should equal: 4.6[2] where [2] equals a superscripted 2 colored blue.
> > (unable to dupe this here hence [2].)
> >
> > Please let me know.
> > Thank you.

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 option boxes to linked cell-linked cell to be 1,2,3. Paula Microsoft Excel Programming 1 29th Oct 2009 01:43 PM
convert 5 characters in a cell to 6 characters by adding a zero Helenf Microsoft Excel Misc 0 18th May 2009 03:08 PM
How do I have a linked cell auto-size to fit the linked data? CristinPDX Microsoft Excel Misc 2 24th Jun 2008 10:29 PM
# of characters visible from a linked cell =?Utf-8?B?dmVyeWVhdnk=?= Microsoft Excel Misc 1 12th Oct 2007 01:48 AM
Why is a linked cell restricted to 256 characters =?Utf-8?B?RXhjZWwgaGVscCBuZWVkZWQ=?= Microsoft Excel Misc 4 16th Feb 2005 12:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:56 PM.