Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Text to Columns help with my data

Steve:

Try this one. Position the cursor in a cell in the column with the data.

It does not work properly if there are numbers or other symbols.

ie 123
gives 123 CORP123@123 and corp.com

I'm not sure if that is a concern.

Sub split_name_email_name()
Dim lRowStart As Long, lRowEnd As Long, lRow As Long
Dim lColumn As Long
Dim lFirstLC As Long, lLen As Long
Dim s As String
Dim c As String

Application.ScreenUpdating = False
lRowStart = ActiveCell.CurrentRegion.Row
lColumn = ActiveCell.CurrentRegion.Column
lRowEnd = lRowStart + ActiveCell.CurrentRegion.Rows.Count - 1

For lRow = lRowStart To lRowEnd
s = Cells(lRow, lColumn)
lLen = Len(s)
lFirstLC = 1
Do While lFirstLC <= lLen
c = Mid(s, lFirstLC, 1)
If c = "a" And c <= "z" Then
Cells(lRow, lColumn + 1) = Left(s, lFirstLC - 1)
Cells(lRow, lColumn + 2) = Right(s, lLen - lFirstLC + 1)
Exit Do
End If
lFirstLC = lFirstLC + 1
Loop
Next lRow

Application.ScreenUpdating = True
End Sub

--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"smoloco" wrote:

Hi gang,

Thanks in advance for any help you have:

I've got data in a column that looks roughly like this:

JOHNS PLUMBING


Note, all the data in the column has the company name FIRST in capital
letters. The email address for the company is immediately after the
company name (and never has a space between the company and the email
address). Also, the email address always is in small caps.

So, here's the challenge: I need to turn this single data column into
two columns: one column for the company name and another column for the
email address.

I surely need the help with the formula or the excel tool.

Thanks in advance!

Steve


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
Duplicate Data Search Thomas O Excel Discussion (Misc queries) 3 May 1st 06 12:45 AM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
How to convert columns of data to one column of text devlkat Excel Worksheet Functions 3 April 6th 05 04:08 PM


All times are GMT +1. The time now is 11:44 PM.

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

About Us

"It's about Microsoft Excel"