+ Reply to Thread
Results 1 to 8 of 8

Creating an excel macro with a filter condition.Help

  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2007
    Posts
    30

    Creating an excel macro with a filter condition.Help

    Hi members i am a bit in a mesh to filter certain data according to my condition to make my work simplier...i hope there must be a way out...

    I have certain data in column A like in A1(12543 | sgh KJY-56 | 4142)
    In column A2 (Pku | 551 | RJK-55 ,) AND SO ON...is long..

    now what i want is that i want just The Values which are attached with a hyphen(eg Like "PTS-58" OR LIKE SST-213) Can i filter my column in such a way that just such values remain and others do not..please help

    Note : Text delimate or Fixed width does not work as the values which iwant are not in same line or saperated by same character in every cell.


    Can any one create an excel macro on this so that i can use it in every sheet..?? Also note it will be more good if suppose some values have a space like "AFT- 63" or "AFT -52" PLEASE NOTE THERE IS A GAP BETWEEN AFT- AND THE NUMBER...i also want to remove that space....if possible..
    For information i want to tell you that the values i want is always of Three Alphabets...expert kingly help
    Last edited by rishi.ssh; 04-17-2012 at 03:52 PM.

  2. #2
    Registered User
    Join Date
    04-13-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Creating an excel macro with a filter condition.Help

    Some one please help...need it badly..

  3. #3
    Registered User
    Join Date
    04-13-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Creating an excel macro with a filter condition.Help

    Any expert on this..??

  4. #4
    Registered User
    Join Date
    04-13-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Creating an excel macro with a filter condition.Help

    If that space between them isint possible than that will also do...as almost 80% of my data is without space..just attached with hyphen.

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Creating an excel macro with a filter condition.Help

    could not figure out a formulaic way of doing this, hence explored the "regular expression" route. see if this helps you in your quest.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  6. #6
    Registered User
    Join Date
    04-13-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Creating an excel macro with a filter condition.Help

    Heys whats dat in attachment....where is d solution...???

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Creating an excel macro with a filter condition.Help

    UDF

    =Hyphen(A1)
    Please Login or Register  to view this content.

  8. #8
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Creating an excel macro with a filter condition.Help

    @rishissh:

    the attachment that i have posted has a UDF in it called RishiSSH. you have to use it as a function call, like you would any other excel function. but first, you have to enable macros while opening that file.

    if your record is in A1, then put =rishissh(A1) in B1 to have the string extracted into B1.

    jindon's UDF is tighter and simpler; if you want to use that you would have to copy that into a VBA module and call it like a worksheet function.
    Last edited by icestationzbra; 05-06-2012 at 01:46 AM. Reason: additional details

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1