Macro Needed

B

BurgrLvr

I need a macro to separate data in column A at the FIRST hyphen and
capitalize the first letter in column B after separation. Can anyone help me
on this? Thanks!
 
M

Mike H

Hi,

You can have a macro if you want but you don't need one.

To extract the text after the hyphen an capitalise the first letter use this
and drag down

=UPPER(LEFT(MID(A1,FIND("-",A1)+1,LEN(A1)),1))&MID(A1,FIND("-",A1)+2,LEN(A1))

and if you want to extract the first part before the hyphen


=LEFT(A1,FIND("-",A1)-1)
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
B

BurgrLvr

Hi Mike, I want to text to columns to separate the data into two columns at
the first hyphen and capitalize the first letter in both columns with no
preceding spaces.
 
M

Mike H

From your original post

This suggests you have more than one hyphen so text to columns will split on
EVERY hyphen. Did you try the 2 formula I gave you?

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
B

BurgrLvr

Yes, but two things with that, it extracts but does not remove from second
column and dosen't capilalize anything.
 

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