ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Needed (https://www.excelbanter.com/excel-programming/439977-macro-needed.html)

BurgrLvr

Macro Needed
 
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!

Mike H

Macro Needed
 
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.


"BurgrLvr" wrote:

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!


BurgrLvr

Macro Needed
 
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.

"Mike H" wrote:

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.


"BurgrLvr" wrote:

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!


Mike H

Macro Needed
 
From your original post

I need a macro to separate data in column A at the FIRST hyphen and


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.


"BurgrLvr" wrote:

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.

"Mike H" wrote:

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.


"BurgrLvr" wrote:

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!


BurgrLvr

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

"Mike H" wrote:

From your original post

I need a macro to separate data in column A at the FIRST hyphen and


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.


"BurgrLvr" wrote:

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.

"Mike H" wrote:

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.


"BurgrLvr" wrote:

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!



All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com