ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Change font in portions of cell with many characters (1000's) (https://www.excelbanter.com/excel-discussion-misc-queries/193631-change-font-portions-cell-many-characters-1000s.html)

Barb Reinhardt

Change font in portions of cell with many characters (1000's)
 
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


Gord Dibben

Change font in portions of cell with many characters (1000's)
 
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

On Thu, 3 Jul 2008 12:20:02 -0700, Barb Reinhardt
wrote:

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



Ron Rosenfeld

Change font in portions of cell with many characters (1000's)
 
On Thu, 3 Jul 2008 12:20:02 -0700, Barb Reinhardt
wrote:

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

Gord Dibben

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

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


Gord

On Thu, 03 Jul 2008 16:44:45 -0400, Ron Rosenfeld
wrote:

On Thu, 3 Jul 2008 12:20:02 -0700, Barb Reinhardt
wrote:

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 Rosenfeld

Change font in portions of cell with many characters (1000's)
 
On Thu, 03 Jul 2008 14:17:09 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

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

Gord Dibben

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

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

Gord

On Thu, 03 Jul 2008 17:36:51 -0400, Ron Rosenfeld
wrote:

On Thu, 03 Jul 2008 14:17:09 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

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



Ron Rosenfeld

Change font in portions of cell with many characters (1000's)
 
On Thu, 03 Jul 2008 15:01:31 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

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


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com