I have one column data that I want to extract specified abbrevation – which is listed – in to separate column so I can easily group the other column. Is there way to do automatically?
regards,
Indra
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » extract specified text from column (IE 5.5)
You can create a lookupof possibilities with their abbreviation.
many seemed to be able to be gotten with:
=MID(A2,2,4)
copied down a column, but there are some that do not work
=IF(ISNUMBER(MATCH(MID(A2,2,4),’list abbrevation’!$A$3:$A$8,0)),MID(A2,2,4),”???”)
copied down will guess at the abbreviation and if it is in the list, it will display it otherwise it will be “???” and you can manually just check on those
Steve
(Edited by sdckapr on 24-May-06 12:18. Added PS)
You can use a custom function.
Add this to a module in the workbook:
Option Explicit Function GetAbbr(sDesc As String, rAbbr As Range) Dim rCell As Range For Each rCell In rAbbr If InStr(sDesc, rCell.Value) 0 Then GetAbbr = rCell.Value Set rCell = Nothing Exit Function End If Next GetAbbr = CVErr(xlErrNA) Set rCell = Nothing End Function
Then you can enter in C2 (expand the range of abbreviations as desired)
=GetAbbr(A2,'list abbrevation'!$A$3:$A$8)
And copy down column C. The function goes thru each of the values in the “abbreviation range” and sees if it is in the string. The first one found is considered the abbreviation and the function stops looking any more.. If none are found a #NA is given (change to something else if desired).
Steve
PS if you want the search to be non-case sensitive use the line:
If InStr(UCase(sDesc), UCase(rCell.Value)) 0 Then
Hi guys, it’s me again.
where i can learn macro/vba like you did to my problem above, or any modul/website/book you could give me for reference?
I have enough in excel function, but in some case it not support anymore
I’ve tried (not hard enough I think,) to read some book and browse some material but my ability stuck in the level such as copy paste or only insert vba modul : )
I am an accountant for not profit organisation, and my objective is to learn any vba stuff relate my job.
Thanks again
indra
See post 539,691 for some book recommendations.
How to use Visual Basic for Applications in Excel contains links to Microsoft articles about Excel VBA.
If you search Google for excel vba tutorial you’ll find many online tutorials.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.