Change font in portions of cell with many characters (1000's)

  • Thread starter Thread starter Barb Reinhardt
  • Start date Start date
B

Barb Reinhardt

In a "normal" cell, I've been able to go in and change the font
color/bold/etc. for several characters in the cell as desired. I'm trying
to do the same thing programmatically for a cell with 1000's of characters
and it's not working. I've tried it manually as well with no success. Is
there a limit on the number of characters in a cell before this no longer
works?
Thanks,
Barb Reinhardt
 
Probably 1024 which is the limit you can see or print.

32,767 can be entered in a cell but with above limits.


Gord Dibben MS Excel MVP
 
In a "normal" cell, I've been able to go in and change the font
color/bold/etc. for several characters in the cell as desired. I'm trying
to do the same thing programmatically for a cell with 1000's of characters
and it's not working. I've tried it manually as well with no success. Is
there a limit on the number of characters in a cell before this no longer
works?
Thanks,
Barb Reinhardt

Excel 2007:

I just created a cell with 7000 characters and was able to manually change some
characters near the beginning to BOLD, and some others to RED/BOLD/ITALIC.

I then ran this macro and it behaved as expected:
=========================
Sub foo()
Dim c As Range
Set c = Range("H1")
With c
.Font.Bold = False
.Font.Italic = False
.Font.Color = vbBlack
.Characters(10, 5).Font.Bold = True
.Characters(100, 20).Font.Bold = True
.Characters(100, 20).Font.Color = vbRed
.Characters(100, 20).Font.Italic = True
End With
End Sub
==============================
--ron
 
Ron

How does it behave when you change the 100 to 3000?


Gord

It seems to behave as expected. At least with Excel 2007, there are
circumstances under which I can see all 7000 characters in the cell. (I didn't
count to ensure the red/bold/italic started at 3000, but it looks about right,
and is 20 characters long).

--ron
 
Thanks Ron

Not using 2007 puts me at a disadvantage and leaves me open to possibly
misleading statements.

Gord
 
Thanks Ron

Not using 2007 puts me at a disadvantage and leaves me open to possibly
misleading statements.

Gord

The specifications still indicate:

Total number of characters that a cell can contain 32,767 characters

but I don't see a separate listing for the number of characters that can be
displayed.
--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top