+ Reply to Thread
Results 1 to 19 of 19

Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a column

  1. #1
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Unhappy Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a column

    Hello there!

    I have an Excel 2003 database, containing movie titles in one really long column.
    What I need to accomplish, may be quite tricky, but here goes...

    I would like to REMOVE the FIRST occurrence of "The " (and the space after it) from the beginning of each movie title
    (ONLY the ones that START with: "The " of course), and then add: ", The" to the END of the movie title. (comma,space,"The")

    >>> Movie title, BEFORE running the macro:
    "The Monster From Behind The Dumpster At The KFC"
    (notice that there are 3 occurrences of "The" - - - - the 2nd,3rd, etc... occurrences, are to be ignored, of course).

    >>> Movie title, AFTER running the macro:
    "Monster From Behind The Dumpster At The KFC, The"

    I hope that somebody out there knows how to code a macro, that can do this...
    I am certainly not looking forward to doing over 6,000 titles, manually... yikes!

    Thank-You for your time, in reading my humble request for help.
    Best Regards;
    Lrrr.
    Last edited by Lrrr; 04-05-2015 at 12:36 AM. Reason: forgot an "eek" smiley.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,930

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    I would do this with a helper column...
    A
    B
    1
    The aaa bbb ccc aaa bbb ccc, The
    2
    aaa bbb ccc aaa bbb ccc

    B1=IF(LEFT(A1,4)="the ",MID(A1,5,99)&", The",A1)
    copied down.

    You could then copy/paste values from the helper over your original date, then delete the helper, if needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Exclamation Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Thanks FDibbins, but unfortunately that would be just as much work as doing it manually.
    It's ANY form of "editing", that I am really trying to avoid.

    I'm VERY FAMOUS -- but not a lot of people know...

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,930

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    There is no editing, you copy down and its all done. If needed, you could then copy/paste values

    Did you even try it?

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Go ahead and post the file and I'll get it done for you.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Click go advanced at the bottom of the box you type your replies into.
    Then click on the paperclip icon and post your spreadsheet.

    View Pic
    Last edited by skywriter; 04-05-2015 at 01:14 PM.

  7. #7
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Smile Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    skywriter: Go ahead and post the file and I'll get it done for you.
    skywriter: Click go advanced at the bottom of the box you type your replies into.
    Then click on the paperclip icon and post your spreadsheet.
    Attached, is one of the TV-Show spreadsheets - the Movie ones will also work the same way...
    I have been fooling around with some "helper columns" at the right, but
    I still can't get my desired result, without cutting and pasting - which
    is what I would like to avoid.
    Thank-You sooooo much!
    Lrrr
    Attached Files Attached Files
    Last edited by Lrrr; 04-05-2015 at 04:45 PM.

  8. #8
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Hi Ford;
    It's all the copying and pasting, that I am trying to avoid.
    I estimate thousands of this change to make...

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,930

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    You are not using the formula I suggested. You have...
    =IF(LEFT(E4,4)="The ",MID(E4,5,99)&", The",E4:E4=I4)

    1st, change the format from TEXT to GENERAL
    2nd, use this, copied down...
    =IF(LEFT(E4,4)="The ",MID(E4,5,99)&", The",E4)

    Once you have that...
    double-click the square inthe botton-right corner of the cell - that should copy the formula all the way down
    Last edited by FDibbins; 04-05-2015 at 04:55 PM.

  10. #10
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Now the problem is, that I can't cut and paste the result that is achieved in column I, because it is a "calc" column.
    So, no copying I to E.

    On another note;
    I moused-over your reputation bar, and "beyond repute" is incorrect - it should be "beyond reproach", or "above reproach".

    Lrrr
    Attached Files Attached Files
    Last edited by Lrrr; 04-05-2015 at 05:22 PM.

  11. #11
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Add this macro to your sheet.
    Select all the movie titles or whatever it is you want to change and run the macro.
    The easiest way to select is select the top title press Control + Shift and then the down arrow and it will select them all the way to the bottom, then run the macro.

    Good Luck!!!

    Please Login or Register  to view this content.

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Hi Lrrr

    You'll not need Helper Columns if the we can change the Data directly in Column E. Is that OK?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  13. #13
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    That is EXACTLY what I am looking for!
    AWESOME!
    How are you able to DO that, when the SOURCE TEXT is in column E?
    Lrrr

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,930

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Now the problem is, that I can't cut and paste the result that is achieved in column I, because it is a "calc" column.
    So, no copying I to E.
    Not sure what you mean by that?
    For the copy/paste...
    1. Highlight I4-down
    2. press CTRL C (Copy)
    3. Click on E4
    4. Seclect Paste special - Values

    I moused-over your reputation bar, and "beyond repute" is incorrect - it should be "beyond reproach", or "above reproach".
    I will take that as a good comment

  15. #15
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Paste special - Values...... AAAhhhhhhhhhh - didn't know that.
    Thanks, buddy!
    Lrrr.

  16. #16
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Hi Lrrr
    Assuming this
    if the we can change the Data directly in Column E. Is that OK?
    Try this
    Please Login or Register  to view this content.
    Attached Files Attached Files

  17. #17
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,930

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Im happy we got this resolved for you Thanks for the feedback

  18. #18
    Registered User
    Join Date
    04-04-2015
    Location
    dumb canada
    MS-Off Ver
    2003 / 2007
    Posts
    9

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Quote Originally Posted by jaslake View Post
    Hi Lrrr
    Assuming this

    Try this
    Please Login or Register  to view this content.
    Hi there, John!
    Thank-You soooo much for your code!
    The only little problem that occurred, was, whenever a title starts with a word like "There" (as in "There Goes The Neighborhood"),
    it changes it to "re Goes The Neighborhood, The".
    If the space after the word "The" was considered (as in "The ", I'm sure it could work perfectly!

    Best Regards;
    Lrrr

  19. #19
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need to batch-change: "The AnyMovieTitle" - - - to - - - "AnyMovieTitle, The" in a co

    Hi Lrrr

    Change the Line of Code
    Please Login or Register  to view this content.
    To
    Please Login or Register  to view this content.
    (add a space in "The ")

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  2. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  3. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  4. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  5. Replies: 3
    Last Post: 07-27-2008, 06:31 AM

Tags for this Thread

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