Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default macor to split cells

Hello
I was wondering if anyone knows of a macro that will split the cells in
excel. I have a cell with 6 numbersm then a dash, then words and would like
to split it into two cells, one witht the numbers and one with the words. Any
ideas? Thanks a lot!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default macor to split cells

You can only split the cell if it was previously merged.




" wrote:

Hello
I was wondering if anyone knows of a macro that will split the cells in
excel. I have a cell with 6 numbersm then a dash, then words and would like
to split it into two cells, one witht the numbers and one with the words. Any
ideas? Thanks a lot!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default macor to split cells

Record yourself doing DataText to ColumnsDe-limited by a hyphen.


Gord Dibben MS Excel MVP

On Mon, 16 Feb 2009 13:01:01 -0800,
m wrote:

Hello
I was wondering if anyone knows of a macro that will split the cells in
excel. I have a cell with 6 numbersm then a dash, then words and would like
to split it into two cells, one witht the numbers and one with the words. Any
ideas? Thanks a lot!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default macor to split cells

I'm not sure what you mean by "6 numbers", but let's cell the contents of
each cell in Column A looks like this example (assumed to be in cell A1):

123456-A bunch of words after the dash

In cell B1, you enter the formula "=LEFT(A1,FIND("-",A1)-1)"

In cell C1, you enter the formula "=RIGHT(A1,LEN(A1)-FIND("-",A1))"

These formulas take everything to the left of the dash and put it into one
cell, and everything to the right of the dash and put it in the next cell,
effectively "splitting" the contents of the cell. The dash is left out.

You can then copy cells B1 and C1 to the clipboard, select all cells that
you want to split, and select "Edit/Paste Special..." from the menu.
Finally, select "Formulas", and you will have split all the cells.

You don't need a macro to do it.

Now, if you're really trying to split cells, see the first response!

HTH,

Eric

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default macor to split cells

here is the onsheet formula
123456 excel is easy 123456-excel is easy

C7 = 123456-excel is easy
A7 = =LEFT(C7,6)
B7 = =MID(C7,8,LEN(C7)-6)







" wrote:

Hello
I was wondering if anyone knows of a macro that will split the cells in
excel. I have a cell with 6 numbersm then a dash, then words and would like
to split it into two cells, one witht the numbers and one with the words. Any
ideas? Thanks a lot!

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
Help with Macor gsxith3 New Users to Excel 1 August 2nd 08 01:31 PM
Macor JakeShipley2008 Excel Discussion (Misc queries) 3 June 21st 07 04:40 PM
master macor Neil Excel Discussion (Misc queries) 1 March 2nd 07 04:39 PM
How to create a macor to count the usage of another macor Jigu Excel Discussion (Misc queries) 0 March 11th 06 03:28 AM
end sub in If then macor P. Blaauw Excel Programming 3 September 20th 03 05:25 PM


All times are GMT +1. The time now is 02:21 AM.

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"