Format that Omits Characters

L

Lemmesee

I need a format that omits all of the characters before a hyphen (-) and one
after it.
example;
001- ABC displayed as ABC

I can easily do this with a formula but I need to do it in a format.
 
S

Sheeloo

I don't think this can be done...

I will be happy to learn a new trick if someone provides a solution.
 
S

Sheeloo

That will solve your problem, won't it?

To the best of my knowledge and belief, I don't think it is possible.

However I have learnt not to say 'never'...
 
L

Lemmesee

Yes it would but i will just have to settle for using a formula in another
column and hide the column with the original text in it..
But much thanks anyway.
 
F

Fred Smith

The formula which omits the first five characters would be:

=mid(a1,6,100)

Regards,
Fred.
 
S

ShaneDevenshire

Hi,

Here is a little bit of code which will do what you want. You could modify
it to be more general.

Sub Hide5Spaces()
Dim cell As Range
For Each cell In Selection
cell.Characters(Start:=1, Length:=5).Font.ColorIndex = 2
Next cell
End Sub

Right now it works only for the first five characters and it work if the
background cell fill is none. But you could change all that.

If this helps, please click the Yes button.
 
L

Lemmesee

I dont see how to make the code run.

ShaneDevenshire said:
Hi,

Here is a little bit of code which will do what you want. You could modify
it to be more general.

Sub Hide5Spaces()
Dim cell As Range
For Each cell In Selection
cell.Characters(Start:=1, Length:=5).Font.ColorIndex = 2
Next cell
End Sub

Right now it works only for the first five characters and it work if the
background cell fill is none. But you could change all that.

If this helps, please click the Yes button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top