Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PLEASE HELP MACRO NEEDED K[_2_] Excel Programming 3 April 30th 08 07:13 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to set macro security in Excel to minimum Carl Excel Programming 3 March 18th 06 03:36 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"