Extracting name out of line

I am copying a line off the web with 4 names in it, separated by 
spaces (From 1 to 6 spaces).  I am trying to extract name 3 from the 
line.  Tried split(Var, " ") however Name moves according to the space 
between the names. Var(2) can be the Name or according to spaces 
between names, Var(6)

Can you help me?

Thank you, Gordon

0
gwelch1938 (25)
1/27/2007 11:37:39 PM
excel 39879 articles. 2 followers. Follow

1 Replies
369 Views

Similar Articles

[PageSpeed] 15

On 27 Jan 2007 15:37:39 -0800, "Gordon" <gwelch1938@yahoo.com> wrote:

>I am copying a line off the web with 4 names in it, separated by 
>spaces (From 1 to 6 spaces).  I am trying to extract name 3 from the 
>line.  Tried split(Var, " ") however Name moves according to the space 
>between the names. Var(2) can be the Name or according to spaces 
>between names, Var(6)
>
>Can you help me?
>
>Thank you, Gordon

Here's an example using regular expressions.  The example extracts all of the
names, but if you just want name 3, then:

Debug.print colMatches(2)

(the count is zero-based)

===================================
Option Explicit

Sub ParseNames()
Const T As String = "Name1    Name2 Name3    Name4"
Dim i As Long

Dim objRe As Object
Dim colMatches As Object
Const Pattern As String = "\w+"

Set objRe = CreateObject("vbscript.regexp")
objRe.Global = True
objRe.Pattern = Pattern

If objRe.test(T) = True Then
 Set colMatches = objRe.Execute(T)
 
 For i = 0 To colMatches.Count - 1
 Debug.Print colMatches(i)
 Next i
 
End If

End Sub

==============================

For just Name 3, 
--ron
0
ronrosenfeld (3122)
1/28/2007 1:41:18 AM
Reply:

Similar Artilces:

RMA ( Credit) Missing Line Items
This is a multi-part message in MIME format. ------=_NextPart_000_0056_01C87CA9.5D5D6C20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Two RMA documents were received and then set as "Ready to Close". Both = documents show, in GP, as "History" but missing the line items. Checked the SQL tables and both RMA documents are in the "open" tables = (SVC05000 and SVC05200) and the line items are in the tables and appear = to be linked to the header. =20 How do we get the line items to appear on the RMA docu...

I delete an email it remains in folder with line through it
How do I move deleted email from in box to deleted subfile without keeping a copy in the inbox with strikethru in it?? I have to email accounts on the computer one is pop3 the other is ms exchange? Not good with computers Are you sure its pop3 and exchange? it sounds like you set up an IMAP account - deleted items are marked with a strikethrough until you purge the folder from the edit menu. You can also use a view that hides items marked for deletion. We can be more specific if we knew the version of Outlook you use. -- Diane Poremsky [MVP - Outlook] Need Help with Common Tasks? htt...

pivot from more than 65K lines: how?
What I am trying to do: have several excel files with data and want to consolidate in a single file What I did: tried to paste all the data in a single file and create a pivot from there... the problem is that I can not copy after reaching 65K lines.... Trying to create a pivot from *multiple* excel does not give me the possibility to put in the layout the fields I want (as if I was using a single sheet)... as it consolidates all the fields in the different tables... Any urgent help please?.. MANY TIA! luis Do you have Access? If so then import all your excel sheets into a singl...

Bottom border line won't print in Word 2004 for Mac
Version: 2004 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel On the screen I can place a page border in Word 2004 for Mac document, but in Print Preview the bottom line of the border disappears. And, of course, when I print, the bottom line won't appear. It doesn't appear that any footer (which I don't want) is in the way of the margin that I have set. Any solution to this? See: http://word.mvps.org/faqs/formatting/BottomsDontPrint.htm Also confirm that you have the latest printer driver from the mfr's web site as well as all current updates for Offi...

double lines
I am trying to type and address in a cell and can't get it to drop down to make another line, please help Use Alt-Enter instead of just Enter......... Vaya con Dios, Chuck, CABGx3 "WFDFirefighter" <WFDFirefighter@discussions.microsoft.com> wrote in message news:A657DEAE-5171-45AE-A57D-F8CE2DB5F122@microsoft.com... > I am trying to type and address in a cell and can't get it to drop down to > make another line, please help Hello- Chuck's reply is valid for creating a line break in a cell, so no challenge there. Just a suggestion, though - it sounds l...

sender domain name?
I have one Exchange 2003 in a semi-lab setup. It is part of my lab domain, we'll call it test.domain, so my server is mail.test.domain Obviously test.domain is not resolveable from the Internet and when I send mail, it goes out as test.domain. How can I make this server send mail out as mail.blah.com so its resolveable? (and will quit bouncing all my messages to domains that do reverse dns lookups?) Thanks for any and all help!! -Mike Change the addressing. You might consider adding a subdomain to your production domain like test.company.com, registering it with an MX record ...

Printing all worksheet names
Does anyone know if it possible to print a list of worksheet names? A list similar to the one you would find in the "Contents" tab of the files' Properties. Thanks for any help you can provide. Programme - XP Excel Hi This topic was covered lately in microsoft.excel.worksheet.functions NG (thread 'print sheet tab names' started by JDB at 06.01.2004 16:00). Here is the solution from me: Create an UDF --- Public Function TabByIndex(TabIndex As Integer) As String Application.Volatile TabByIndex = Sheets(TabIndex).Name End Function --- On some empty worksheet,...

XmlSerializer/XmlTextWriter all data on one line
I'm an XML newb. I'm serializing a class and when I inspect the xml file, all the data is on one line rather than being nested and indented Is that normal? <code> StreamWriter sw = new StreamWriter(m_optionsXmlFilePath, false); XmlSerializer xmlSerializer = new XmlSerializer(typeof(Options)); XmlTextWriter xmlTextWriter = new XmlTextWriter(sw); xmlSerializer.Serialize(xmlTextWriter, this); xmlTextWriter.Close(); </code> Hello! > I'm serializing a class and when I inspect the xml file, all the data is on > one line rather than being nested and indented > ...

file name using a templete
Thank to all that helped with my project. This is the code I want to use. It seems to work ok and I can kind of follow it. As you can see I'm using KY2D2003.Xls as the file name and the code depends on it. My final question I hope is. If I save it as a template when you pull it up office rename the file to KY2D20031.Xls and so on. How can I make the code corresponded with what ever the file is named with out changing the code dramatically? I would like to just be able to use some variable or something to replace KY2D2003.Xls in the code. Private Sub Worksheet_Change(ByVal Target...

Windows 2000 server user names
Where can I configure the user names formatting like you do in Recipient policies? yaro ...

xy scatter line goes below zero
The line drawn in my xy scatter chart goes below zero of the y-axis, is there any way I can stop this? My first 3 points are all zero and then there is a very steep increase, the line that connects them assumes that there is a dip into negative values before the increase when this is not actually the case. Hi, Have you got the Smooth line option ticked? Cheers Andy jon7 wrote: > The line drawn in my xy scatter chart goes below zero of the y-axis, is there > any way I can stop this? My first 3 points are all zero and then there is a > very steep increase, the line that connect...

Cell extraction from Multiple worksheets
Hi group, I am new to this newsgroup and am hoping that you can help me out. I took a software/hardware inventory of all the computers in my work's network and imported them all into excel, in their own worksheet. So I have one file, with 128 different worksheets, all containing similar information. What I would like to do is create a new sheet, a summary page, where I can pull the value of the same cell from each sheet and list them. I need to have a list of each computer, with computer name, cpu speed, video card, serial number, ect. If the values that I am searching for are in the same...

SSL Certificate server name is incorrect
I get the message (Exchange server 2003 SP1) The SSL certificate server name is incorrect ID no: c103b404 Exchange System Manager When I try to open the propertie-page of any public folder. Does anyone knows of a way to correct this ? TIA Rudy Steyaert Rudy, I assume this is related to the fact you specified HTTPS / SSL on the overall "default web site" in IIS. If SSL is configured for your Exchange OWA, it's only necessary to force SSL on the Exchange FOlder, not the Public or ExchWeb. As the Public Folder properties in your Exchange system manager are making use of...

Big problem! DNS name Space.
I have a need to share one DNS name space between four AD Exchange forest ( I know what your thinking, why would you do this! All I can say it’s government). All the forests are running Windows 2000 with Exchange 2003. My problem is I can’t seem to find a way to allow this to happen. I know it’s easy to accomplish this if it was just two forests, but how do you share the same E-mail address across four AD forest? Basically I need mail to come in into the first Exch Org and if the recipient is not found on that Exch Org to continue down the line to the next Org, in till the user is foun...

Inventory Site/LocationCode Order Lines on MSCRM1.2 to GPS8.0
We are currently running MSCRM 1.2 and GPS 8.0, with the MS Integration between them. Our Sales force uses various Inventory locations when placing orders within our GPS system. Because of business reasons we can't consolidate into a single Inventory Location as the Integration documentation suggests. The documentation allow says that it only supports the use of one Inventory location, which you set in the "Settings and Administration" tool. It appears that you can modify the BizTalk Mapping for the SalesOrderDetail channel to route a value from a custom field in MSCRM...

double lines and rounded corners on a solid box
How can I create a solid box with double lines and rounded corners in Publisher 2000? Thanks Anna You will have to use an AutoShape -- ...

Extracting name out of line
I am copying a line off the web with 4 names in it, separated by spaces (From 1 to 6 spaces). I am trying to extract name 3 from the line. Tried split(Var, " ") however Name moves according to the space between the names. Var(2) can be the Name or according to spaces between names, Var(6) Can you help me? Thank you, Gordon On 27 Jan 2007 15:37:39 -0800, "Gordon" <gwelch1938@yahoo.com> wrote: >I am copying a line off the web with 4 names in it, separated by >spaces (From 1 to 6 spaces). I am trying to extract name 3 from the >line. Tried split(V...

Line of Credit Account #2
This is driving me nuts. What is the best way to set up a Line of Credit (LOC) account? It is actually a $500 LOC account for my checking account for when my checking account dips below $0. Both the checking account and LOC accounts import separately into Money from my bank. Should I set up the LOC as an account, a liability, or as "other". I tried them but keep getting confused because depending on whether the LOC automatically deposited money into my checking account or I transferred money from my checking account to pay off my LOC, it will say either "From" o...

#NAME? Error With User Defined Functions
Excel 2007 I have a problem that has been driving me nuts. I created a code module and have pasted a couple of user defined functions into the module. When I am entering my formula into a cell and I start typing the name of the function, I see that the function is listed in the drop-down list of functions. That tells me that Excel recognizes the function. However, after entering the formula I get a #NAME? error. Here is a link to just one of the user defined functions that I've been trying to use. http://xldynamic.com/source/xld.ColourCounter.html#code Other peo...

how to capture the event changing the name of a sheet
I would like to trigger a procedure whenever a user change the sheet name or add anew sheet. The event of new sheet can be captured but I don't know how to capture the event changing sheet's name. Please help No event is generated when a sheet changes names... What were you needing the event for? Perhaps we can help you get around the problem. -- HTH... Jim Thomlinson "Satyapal Kaushal" wrote: > I would like to trigger a procedure whenever a user change the sheet name or > add anew sheet. The event of new sheet can be captured but I don't...

Sheet you want to copy contains the name...
When I copy a worksheet I get the repeated message box that the destination workbook already contains the name "a", "aa", "prntoutline", "ssd", "q" and "zz". I have to select yes to each message box to allow the worksheet copy to complete itself. I do not have these names within the worksheet (chekced by Insert>Name>Define). How can I delete these nsmaes that do not seem to exist? Thanks. Names can be hidden, so Insert=>Name=>Define may not show them. In the troublesome workbook make a blank sheet active, then go...

CEditView No line wrap
How do I keep CEditView in my SDI application from wrapping the lines of text entered? i.e., I want the horizontal scrollbar. "Joe Estock" <jestock@NOSPAMnutextonline.com> wrote in message news:vrs98r4qk4so3f@corp.supernews.com... > How do I keep CEditView in my SDI application from wrapping the lines of > text entered? i.e., I want the horizontal scrollbar. Give it the (ES_AUTOHSCROLL|WS_HSCROLL) styles. In a CEditView derived class you can insure this by ORing the CREATESTRUCT.style member in an override of PreCreateWindow. -- Jeff Partch [VC++ MVP] ...

wrong display name
Why is my messenger displaying my name from web from my Live profile??? I've never checked any box that allows to take name from web. I want to use my custom name that I set in my messenger client. And if I wanted to change my name in Live profile in home.live.com then it refuses to accept special characters that I've been using for years in my messenger client. There is something broken, you know, and please fix it as soon as possible. Thanks! Greetings, There are instances where it can change your name to what's in your live profile in Messenger, but you c...

Parsing Names in Excel
I have a list in Excel from A1:A100 with names like the ones mentioned below: Michelle Fooo (michelfoo@exchange.SASMOM.com) Myhaass Smith (mysmith@exchange.SASMOM.com) I want to parse them using string functions to the following format michelfoo@SASMOM.com mysmith@SASMOM.com Any ideas how to do this using a formula? Thanks in advance Michael Michael Are you wanting to strip all the name out too or just remove the exchange.? If the latter just use edit>replace What:=exchange. and leave the with blank -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_...

Exchange Organization Name
Is there any way to extract the exchange organization name from a priv1.edb file? After system crash we have to rebuild the exchange system and have good backups of the edb files but do not know what the exact organization name. Thanks Dave B Hi Dave, You can try opening a copy of the Dir.edb in notepad to see if you can find it in there. If that doesn't work, do you still have the "Exchange Server Setup.log" file that was at the root of the drive? If so, you can search it for the Organization Name. When you search, you can just search for "/o=" and it will have t...