#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default dividing a cell

HandEdie

The above name is in one cell with no separator. How do I split a major
list of this type. The names are in one column

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default dividing a cell

You need VBA for this. Here is a UDF that works
Open VBA, add a module and cpy this into module
On worksheet:
Suppose the first name is in A1, Select B1:C1 enter =Splitter(A1) and commit
with CTRL+SHIFT+ENTER
Copy the two cells down to last name
When done use Copy and Paste Special to convert formulas to text

Need help with VBA?
David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm



Function splitter(onename As String)
Dim temp(2)
myLen = Len(onename)
mySwitch = 1
temp(0) = Mid(onename, 1, 1)
For j = 2 To myLen
myChar = Mid(onename, j, 1)
If mySwitch = 1 Then
If Asc(myChar) 90 Then
temp(0) = temp(0) + myChar
Else
mySwitch = 2
temp(1) = temp(1) + myChar
End If
Else
temp(1) = temp(1) + Mid(onename, j, 1)
End If
MsgBox myChar & mySwitch
Next j
splitter = temp
End Function

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Dendy" wrote in message
...
HandEdie

The above name is in one cell with no separator. How do I split a major
list of this type. The names are in one column

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default dividing a cell

Remove the Msgbox line of code!
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Dendy" wrote in message
...
HandEdie

The above name is in one cell with no separator. How do I split a major
list of this type. The names are in one column

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default dividing a cell

over my head!

"Bernard Liengme" wrote:

You need VBA for this. Here is a UDF that works
Open VBA, add a module and cpy this into module
On worksheet:
Suppose the first name is in A1, Select B1:C1 enter =Splitter(A1) and commit
with CTRL+SHIFT+ENTER
Copy the two cells down to last name
When done use Copy and Paste Special to convert formulas to text

Need help with VBA?
David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm



Function splitter(onename As String)
Dim temp(2)
myLen = Len(onename)
mySwitch = 1
temp(0) = Mid(onename, 1, 1)
For j = 2 To myLen
myChar = Mid(onename, j, 1)
If mySwitch = 1 Then
If Asc(myChar) 90 Then
temp(0) = temp(0) + myChar
Else
mySwitch = 2
temp(1) = temp(1) + myChar
End If
Else
temp(1) = temp(1) + Mid(onename, j, 1)
End If
MsgBox myChar & mySwitch
Next j
splitter = temp
End Function

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Dendy" wrote in message
...
HandEdie

The above name is in one cell with no separator. How do I split a major
list of this type. The names are in one column

Thanks





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default dividing a cell

where do I find the MSGBOX?

"Bernard Liengme" wrote:

Remove the Msgbox line of code!
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Dendy" wrote in message
...
HandEdie

The above name is in one cell with no separator. How do I split a major
list of this type. The names are in one column

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
Dividing cell by sum of two other cells Randi Excel Discussion (Misc queries) 2 November 15th 07 07:02 PM
dividing a cell Bob[_3_] New Users to Excel 9 February 23rd 07 08:28 PM
Dividing a cell Bob[_3_] Excel Worksheet Functions 1 February 22nd 07 08:19 PM
Cell Dividing jenny Excel Worksheet Functions 2 August 7th 06 09:07 PM
Dividing a cell salim Excel Discussion (Misc queries) 1 March 1st 05 12:38 PM


All times are GMT +1. The time now is 01:58 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"