Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 101
Default Character Substitution in Array

In VBA, you can use the .Characters(...).Font statement to change the Name,
FontStyle, Size, etc. of individual characters in a cell. Is there any way
to do the same with a character string in VBA without first placing it into a
cell?

Example - in the string "ABCDEFG", if I want the 'B' to be green, the 'D' to
have a font size of 12, and the 'F' to have the font name 'Symbol', I can put
the string into a cell and then set the individual characters. But can I
take the string inside VBA and do the same, without first placing it into a
cell?

--
Bill @ UAMS
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Character Substitution in Array

I believe the answer to this one is "Sorry, no". A variable or constant in
VBA does not have the attributes available, so yes, you're going to have to
place it into a cell and do the format work at that point.

Think about it just a moment - the properties you are speaking of are
actually part of the Cell's properties, with the Characters being one of the
properties of the cell itself, and the font/color/etc of the individual
characters being a property of the .Characters in the cell.

"BillCPA" wrote:

In VBA, you can use the .Characters(...).Font statement to change the Name,
FontStyle, Size, etc. of individual characters in a cell. Is there any way
to do the same with a character string in VBA without first placing it into a
cell?

Example - in the string "ABCDEFG", if I want the 'B' to be green, the 'D' to
have a font size of 12, and the 'F' to have the font name 'Symbol', I can put
the string into a cell and then set the individual characters. But can I
take the string inside VBA and do the same, without first placing it into a
cell?

--
Bill @ UAMS

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 to multiply all cells in array by factor rhauff Excel Discussion (Misc queries) 2 March 21st 06 03:01 PM
Transpose words and numbers into array of different proportions Manfred Excel Discussion (Misc queries) 5 February 9th 06 01:07 AM
Wildcard Character in an Array Formula Scorpvin Excel Discussion (Misc queries) 2 September 30th 05 06:44 PM
how do I make single character as a variable in an array Hazlgrnguy Excel Worksheet Functions 1 September 25th 05 08:12 AM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 02:06 PM.

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"