Proper function fix sought

N

Niniel

Hello,

I am using a macro with the proper function, but unfortunately, I have some
cells where the content is like this: “Word-Wordâ€. The proper function as is
turns that into “Word-wordâ€. How could it be made to leave that intact?

Thank you.
 
D

Dave Peterson

Depending on what your list of words looks like, maybe:

=SUBSTITUTE(PROPER(SUBSTITUTE(A1,"-"," "))," ","-")

This assumes that there are no spaces in the original list. If there are
spaces, then those spaces will get turned into hyphens.
 
P

Peo Sjoblom

Or don't use a space

=SUBSTITUTE(PROPER(SUBSTITUTE(A1,"-","^^^")),"^^^","-")
 
N

Niniel

Thank you for your replies.
However, I'm not sure I can use that. Below is my macro code. I'm not very
VB literate so I don't know how to implement your ideas.

For Each Cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
Cell.Formula = StrConv(Cell.Formula, vbProperCase)

Next
 

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