+ Reply to Thread
Results 1 to 16 of 16

Reposition the Email and the name

  1. #1
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Reposition the Email and the name

    I have my team mates copy some names and email ids into word 2007 and they are copied as below with names and email ids mixed as shown below;

    [email protected] Chean Kamaar
    [email protected] Viya Rejeshri
    [email protected] Shinnyeshrreyash
    [email protected] Ariyaa J.B.
    [email protected] Jeshwin T. Narayanappa
    [email protected]
    [email protected] Datta
    [email protected]
    [email protected] Ghani Kuzroz
    [email protected] Nevanina Koppa
    [email protected] Basser Berrem

    I want a macro to change the above as below....

    Chean Kamaar - email id - [email protected]
    Viya Rejeshri - email id - [email protected]
    Shinnyeshrreyash - email id - [email protected]
    Ariyaa J.B. - email id - [email protected]
    Jeshwin T. Narayanappa - email id - [email protected]
    - email id - [email protected]
    Datta - email id - [email protected]
    - email id - [email protected]
    Ghani Kuzroz - email id - [email protected]
    Nevanina Koppa - email id - [email protected]
    Basser Berrem - email id - [email protected]

    Thanking you in advance.

  2. #2
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    The names here do not represent either anyone or anyone's email id but a randomly picked ones for example purposes........these names may run into many pages....

  3. #3
    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,917

    Re: Reposition the Email and the name

    This would probably be very simple to do in excel?
    If there is always a space between the Addy and name, a simple text2columns would do this in seconds
    Or a left and MID formula could do the same for you
    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

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Reposition the Email and the name

    You could do that in Word with a wildcard Find/Replace, where:
    Find = ([!^13]@) ([!^13]@)(^13)
    Replace = \2 - email id - \1\3
    No macros required.
    Last edited by macropod; 07-04-2017 at 08:22 PM.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    Thank you both of you for responding ...... I think macropod's solution is working but only the last [email protected] Basser Berrem it is just inserting the - email id - but not doing how I wanted it to be...... the rest of the names are left out even after using the wild card selection and replace all......can you please check this and if possible I need a macro than this find and replace.....thanks for your solutions by the way.....

  6. #6
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    just forgot to mention that we would rather prefer this in MS word itself and not excel sheets...

  7. #7
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Reposition the Email and the name

    Quote Originally Posted by Quivolt View Post
    I think macropod's solution is working but only the last name
    With the F/R expression I posted, the output I get is:
    Chean Kamaar - email id - [email protected]
    Viya Rejeshri - email id - [email protected]
    Shinnyeshrreyash - email id - [email protected]
    Ariyaa J.B. - email id - [email protected]
    Jeshwin T. Narayanappa - email id - [email protected]
    [email protected]
    Datta - email id - [email protected]
    [email protected]
    Ghani Kuzroz - email id - [email protected]
    Nevanina Koppa - email id - [email protected]
    Basser Berrem - email id - [email protected]

    Lines that lack both the name & email address are left alone.

    Note: the F/R expression I posted assumes each line is terminated by a paragraph break. If some are terminated by line breaks you could use:
    Find = ([!^13^l]@) ([!^13^l]@)([^13^l])
    Replace = \2 - email id - \1\3

  8. #8
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    Thanks macropod.... this works....is it possible for you to combine both with paragraph break and line breaks.....into one formula.....find/replace..... or can you give this method in the vba format...thank you in advance....

  9. #9
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Reposition the Email and the name

    Quote Originally Posted by Quivolt View Post
    is it possible for you to combine both with paragraph break and line breaks.....into one formula.....find/replace
    That's precisely what the revised F/R expression already does.

  10. #10
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    yes ......it does the required thing.... how to have this in the form of a vba code....so that i dont have do the Control F and type formulas everytime........
    if you can code this in vba it will be easier for me...as i dont know how to do this.....if it is not too much problem for you.. please can u get me in code format..thanks in advance......macropod

  11. #11
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Reposition the Email and the name

    Have you tried recording the F/R with the macro recorder? The code thus produced wouldn't be much different than a hand-written macro.

  12. #12
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    well.....no....will try that with macro recorder.......but there is some problem if there are lots of data.....

  13. #13
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    thanks macropod.....in advance......

  14. #14
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    Macropod....following was the code which I got....but it is not working.....can you check this please.....

    Please Login or Register  to view this content.

  15. #15
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Reposition the Email and the name

    The amount of data to be processed is of no consequence.

    That said, for some reason unknown to me, you're trying to do two F/R operations, where only one is needed and your second one's Replace expression is wrong. Then you have some cursor movements. All you needed to record was:
    Please Login or Register  to view this content.
    A hand-written version might be:
    Please Login or Register  to view this content.
    As you can see, there's not much difference. The main differences are that the hand-written one turns off screen updating and defaults to processing the entire document.

  16. #16
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    221

    Re: Reposition the Email and the name

    Thanks macropod....this surely helps and meets our requirements...sorry was not able to be online for some time.... i have closed this as solved + rep you

+ 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. Combobox automatically reposition ListIndex
    By jacknomiz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-03-2017, 02:28 AM
  2. [SOLVED] Reposition Columns
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-30-2015, 01:08 PM
  3. Macro to reposition values within cells.
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 39
    Last Post: 01-28-2012, 04:55 PM
  4. Reposition Characters Within A Cell
    By christophercdavis in forum Excel General
    Replies: 2
    Last Post: 03-28-2011, 01:05 PM
  5. Reposition screen based on cell Content.
    By emt3000gt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-12-2007, 02:06 PM
  6. is it to only reposition
    By froggy19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2007, 03:13 PM
  7. how to reposition a data table in chart
    By JohnBonjer in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-06-2006, 07:15 AM

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