LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Function/Programming help with excel

On Sun, 2 Apr 2006 20:18:59 -0500, Excel_Newbie09
wrote:


Hey guys. I am new here and new to excel so go easy on me :)

I have a colum with 21 random characters in each cell. Is it possible
to find the 11th character in each cell within only that colum and to
make that character bold or red or something else so as to make it
stand out. Not sure if this could be done in excel so I thought I might
seek some expert help :D

Cheers


It can be done if the contents of the cell is a text string. It cannot be done
if the string is constructed as the result of an equation.

You can go into each cell, select the eleventh character, and then select the
font characteristics of that character.

Or you can do it with a macro. To enter the macro, <alt<F11 opens the VB
Editor. Ensure your project is highlighted in the project explorer window,
then Insert/Module and paste the code below into the window that opens.

<alt-F8 will open the macro dialog box. Select Bold11 and <Run.

Note that, as written, the macro assumes that your range to be process is
A1:A100. You can easily change this.

The macro also rewrites the range so that it is a Text string, and NOT an
equation. Any equation you had in there will be destroyed. So BACKUP your
worksheet before running this.

==========================
Option Explicit

Sub Bold11()
Dim Src As Range
Dim c As Range
Dim AC As Range

'set range with the 21 random characters
Set Src = [A1:A100]
'remember where the cursor was
Set AC = ActiveCell

'ensure range is only text strings; this may not be necessary
Src.Copy
Src.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
AC.Select


'Bold and redden the 11th charcter in each
For Each c In Src
c.Characters(11, 1).Font.Bold = True
c.Characters(11, 1).Font.Color = vbRed
Next c

End Sub
============================


--ron
 
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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Open Excel 2003 from Windows Explorer pmpjr Excel Discussion (Misc queries) 9 September 11th 06 03:58 PM
Need suggestions for some uses of Ms Excel Bible John Excel Discussion (Misc queries) 1 February 27th 06 05:30 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Excel 2002 and 2000 co-install. Control Which Starts ? cnuk Excel Discussion (Misc queries) 2 January 17th 05 08:07 PM


All times are GMT +1. The time now is 07:36 AM.

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

About Us

"It's about Microsoft Excel"