Bcavs2007
11-24-2014, 07:06 AM
Hi Everyone,
New here but have been searching around in the threads for a while. I was wondering if someone could help me out with my code. I am trying to write a Macro to return the color of individual characters within a cell. In order to do so I have tried to adapt simple code that returns the color of text in a cell thats worked out for me. Anyways What I have written so far is as follows:
Function GetColor3(Mycell As Range)
GetColor3 = Mycell.Characters(Start:=1, Length:=1).ColorIndex
End Function
The issue I am sure is with the ".Characters" statement, I believe I am using it incorrectly. I have a cell with three characters in it, I want to check only the first character for color, the I can adapt the code later to check only the third.
Thanks for the help
New here but have been searching around in the threads for a while. I was wondering if someone could help me out with my code. I am trying to write a Macro to return the color of individual characters within a cell. In order to do so I have tried to adapt simple code that returns the color of text in a cell thats worked out for me. Anyways What I have written so far is as follows:
Function GetColor3(Mycell As Range)
GetColor3 = Mycell.Characters(Start:=1, Length:=1).ColorIndex
End Function
The issue I am sure is with the ".Characters" statement, I believe I am using it incorrectly. I have a cell with three characters in it, I want to check only the first character for color, the I can adapt the code later to check only the third.
Thanks for the help