+ Reply to Thread
Results 1 to 9 of 9

Sort Data by Comment Contents / VB Macro

  1. #1
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    570

    Sort Data by Comment Contents / VB Macro

    Dear All,

    please have a look at the attached file.

    I want to sort the data by the comments in Column B, specifically by comments that do contain a telephone number, whether it is "Telefon" ( e.g. in B17 ) or "Phone" ( e.g. in B24 ) or "Téléphone" ( e.g. in B16 )

    I know a Macro written in VB could do that.

    Any help is much appreciated.

    Thank you. Felix
    Attached Files Attached Files
    Last edited by elgato74; 10-03-2009 at 04:59 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Sort Data by Comment Contents / VB Macro

    It ould be much simpler to have the phone numbers in a hidden column & sort by that column
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    570

    Re: Sort Data by Comment Contents / VB Macro

    Thank you, but how would I transfer the Phone numbers in a hidden cell next to the cell containing the comment ? The original list has over 7000 rows ...

  4. #4
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    570

    Re: Sort Data by Comment Contents / VB Macro

    ... possibly a Macro that extracts the Phone numbers to a cell next to the cell containing the comment ? But that would shift all other data to the right ?

    Is there any way that a Macro would search the Comments in Column B and if it contains the word Telefon, Phone or Téléphone it sorts it to the top ?

  5. #5
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    570

    Re: Sort Data by Comment Contents / VB Macro

    Is there any way that a Macro would search all the Comments in Column B and if it finds the word Telefon, Phone or Téléphone it sorts that row to the top or at least marks it ?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort Data by Comment Contents / VB Macro

    Try this out:
    Please Login or Register  to view this content.
    This sorts first by whether there is a "phone" comment, and then by column D.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    570

    Re: Sort Data by Comment Contents / VB Macro

    You are fantastic ! Superb !

    Now, ideally i would want all the ones with Telefon to be sort first, then all the ones with Phone and then all the ones with Téléphone ...

    Can this also be done ?

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort Data by Comment Contents / VB Macro

    Please Login or Register  to view this content.
    ==========
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  9. #9
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    570

    Re: Sort Data by Comment Contents / VB Macro

    Thank you Thank you Thank you !

    You're the Best

    Have a great day ...

    Felix

+ 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