Advertisement

04.14.2008 at 09:27AM PDT, ID: 23320822
[x]
Attachment Details

Extract letters from mixed string (Excel, Macro, VBA)

Asked by mdadnan in Microsoft Excel Spreadsheet Software, Spreadsheet Software, VB Script

Tags: Macro, VBA

I have a spreadsheet that contains thousands of items.
I am looking to extract all characters until the first colon (:) from RIGHT SIDE only.


COMPAYRNDED:EXANATION:LAEX:PLUSBOB:GL34X         extract (GL34X)
ANY BRANDED:EXINATION:TEX:PLUSBOB:GL34P         extract (GL34P)
MINATION:LATEX:PLUSBOB:MLX34/175         extract (MLX34/175)

and do for multiple rows.

I found some code in EE related to that but that didnt make any sense to me. I would appreciate if someone can help me on that. I know it can be done using Mid and Find but I do not know how I can use them in Macro. Will appreciate the help.
==========================
Public Function PullAlpha(ByVal Text As String) As String

   Dim Result As String
   Dim Index As Long
   
   For Index = 1 To Len(Text)
      If Mid(Text, Index, 1) Like "[A-Z]" Then
         Result = Result & Mid(Text, Index, 1)
      ElseIf Len(Result) > 0 Then
         Exit For
      End If
   Next Index
   
   PullAlpha = IIf(Len(Result) > 0, Result, "BKR")

End Function

Use it in a cell formula like this:

   =PullAlpha(A1)
===========================================


Thanks.

let me know if any questions.
Start Free Trial
[+][-]04.14.2008 at 09:44AM PDT, ID: 21351481

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 09:46AM PDT, ID: 21351493

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, Spreadsheet Software, VB Script
Tags: Macro, VBA
Sign Up Now!
Solution Provided By: rorya
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.14.2008 at 09:51AM PDT, ID: 21351533

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.14.2008 at 09:55AM PDT, ID: 21351568

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 09:59AM PDT, ID: 21351601

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 10:09AM PDT, ID: 21351694

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 10:10AM PDT, ID: 21351710

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 12:45PM PDT, ID: 21353139

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 01:53PM PDT, ID: 21353772

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 02:02PM PDT, ID: 21353854

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 02:37PM PDT, ID: 21354151

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 02:38PM PDT, ID: 21354171

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 03:37PM PDT, ID: 21354531

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628