LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Changing the Color of Specific Characters using a Macro

Could someone please help me with this problem. I am using excel to sift
through thousands of protein and amino acid codes abbreviated by letters.
These codes are chains up to 100 characters long, so it is difficult to read
them all by hand.

what i want to do it is change the color of S everytime it is immediately
followed by a # sign. I wrote a macro that will find all of these, but i
can't figure out how to highlight this specific character. I understand how
to highlight the whole cell, the first letter, or any number of letters, but
not how to highlight the letter I actually searched.

Here is the code I made:

Sub Color_Part_of_Cell()

Dim rCell As Range

For Each rCell In Selection
If InStr(1, rCell, "S#") < 0 Then
rCell.Characters(1, 1).Font.Color = vbBlue
End If
Next rCell
End Sub

-----------------
An example of what i want it R#TSFDGDFT#SEGSHU#HS#GYUGUYG.
I would want only the S with the # after it to turn red, and I would have a
whole column of these sequences, (many are much larger)


Thank you in advance,
Chris


 
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
lookup with some specific characters Gaurav[_2_] Excel Worksheet Functions 6 April 10th 08 02:55 PM
How do I use specific characters to hold value markythesk8erboi Excel Worksheet Functions 1 April 1st 08 07:07 PM
Macro that returns a specific number of characters from a text str Jurassien Excel Discussion (Misc queries) 2 August 1st 07 11:14 PM
Replacing specific characters Trey Excel Discussion (Misc queries) 3 January 20th 06 11:57 PM
Pulling out specific characters Louis Excel Discussion (Misc queries) 4 April 22nd 05 10:05 PM


All times are GMT +1. The time now is 01:40 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"