How do I move specific text via macro
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How do I move specific text via macro
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jul 2019
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How do I move specific text via macro

    Hi

    I have a workbook and I have data all over the place and trying to standardise. Im looking to see if it can be done via macro. What im trying to do is listed below.

    In Column A where data states "FARE METHOD MARKER" I need all the data in the entire row moving across 2 columns .


    In column A where data states "NUMBER OF TRANSACTIONS" I need the rows moving to the bottom of the list but remaining in column A

    In column A where data states "PAYMENT VALUE" I need all the data from Column A and B moved into columns E & F on same row

    In column C where data states"CURRENCY MARKER" I need all the data moved from columns C&D into columns G & H on the same row

    In Column E where data states "DR/CR MARKER" I need all the data from columns E & F moved into W & X on same row

    Where it says in Column E "FARE" I need all the data from columns E onwards moved across 2 columns in same row.

    Where it says in Column G "SALE NO SDCI+" I need all the data from columns G & H moved into U & V in same row

    Where in says in column S "Sale Number (SDCI+)" I need the data in all the rows moved 2 rows to the right so it moves to column U

    Where in says in column S "SUNDRY TRANSACTION NUMBER" I need the data from columns S/T/U/V Cut and pasting in same row from column AF onwards. I also need the empty cells in columns
    U & V deleting so that data from column W onwards moves back 2 rows.


    Any Ideas?

    Thanks

  2. #2
    Board Regular BlakeSkate's Avatar
    Join Date
    Jan 2015
    Location
    Pernsylvoonia
    Posts
    447
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    are there an combinations of these things? say for instance.
    will something in column A with "fare method marker" also have something in column S with "sale number (dsci+)"?

    edit:
    and are these text string you provided unique to their columns?
    meaning if i search the entire worksheet for "sale number(dsci+)" i will only find them in column S, or are they in other columns too, but you don't want these conditions to occur to those columns.
    Last edited by BlakeSkate; Aug 15th, 2019 at 03:15 PM.
    -------------------------------------------------------------------------------
    I may not give the best VBA codes, but they sure are VBA codes.
    Help me help you by posting a snapshot of your data & your expected result
    Please use [ code][ /code] tags when posting VBA as well as proper indentation

  3. #3
    New Member
    Join Date
    Jul 2019
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    are there an combinations of these things? say for instance.
    will something in column A with "fare method marker" also have something in column S with "sale number (dsci+)"?
    No


    and are these text string you provided unique to their columns?
    meaning if i search the entire worksheet for "sale number(dsci+)" i will only find them in column S, or are they in other columns too, but you don't want these conditions to occur to those columns.
    They are in other columns too but where I want them all to end up is in the columns stated.
    Here is the link to where the workbook is and shows before and after data. https://my.pcloud.com/publink/show?c...UYWTteB0w6HKEX

  4. #4
    Board Regular BlakeSkate's Avatar
    Join Date
    Jan 2015
    Location
    Pernsylvoonia
    Posts
    447
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    Quote Originally Posted by donkey12 View Post
    They are in other columns too but where I want them all to end up is in the columns stated.
    Here is the link to where the workbook is and shows before and after data. https://my.pcloud.com/publink/show?c...UYWTteB0w6HKEX
    so you want me to search the entire workbook for these phrases?
    i'll be able to create something tomorrow that will help you sort all of this information
    so if no one else gets it by then i'll be happy to come up with a VBA code for it
    -------------------------------------------------------------------------------
    I may not give the best VBA codes, but they sure are VBA codes.
    Help me help you by posting a snapshot of your data & your expected result
    Please use [ code][ /code] tags when posting VBA as well as proper indentation

  5. #5
    New Member
    Join Date
    Jul 2019
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    Also saved same thing to one drive if that helps https://1drv.ms/u/s!AlFxNGHiZueY-0au...yzwPd?e=AyiIGm

  6. #6
    New Member
    Join Date
    Jul 2019
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    Bladeskate if you could if no one else comes up with an idea that would be absolutely brilliant. I think the workbook sort of will make more sense when you see it. If you want you can amend it and add to that if it easier.

  7. #7
    New Member
    Join Date
    Jul 2019
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    APOLOGIES use this link for one drive..... https://1drv.ms/x/s!AlFxNGHiZueY-0fj...aLD04?e=nnOHba

  8. #8
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,989
    Post Thanks / Like
    Mentioned
    460 Post(s)
    Tagged
    45 Thread(s)

    Default Re: How do I move specific text via macro

    In row 21 you have "Fare Method Marker" and in col C you have "Fare"
    Once that row is moved 2 cells to the right, "Fare" is in col E. Does it then need to be moved 2 cells to the right again from col E?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  9. #9
    New Member
    Join Date
    Jul 2019
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    Sorry fluff im confused on what you meant, If you look at row 290 on the before tab you will see what I mean about moving it over 2 columns.

    Donno if it helps but the top of every column has its own unique header.
    Last edited by donkey12; Aug 15th, 2019 at 04:37 PM. Reason: added comments

  10. #10
    Board Regular BlakeSkate's Avatar
    Join Date
    Jan 2015
    Location
    Pernsylvoonia
    Posts
    447
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I move specific text via macro

    Okay so let me straighten out all of your needs, and PLEASE answer every question:

    1. what i have downloaded shows "Fare Method Marker" in column C.
    Do you want to move this and anything with this exact phrase down two columns still?

    2. Again in column C i have "Payment Value"
    Do you want these moved to E & F still?

    3. (what fluff was saying) if i move "Fare Method Marker" down two columns from C "Fare" will appear in column I.
    from where do you want to move things down another 2 columns?

    actually nevermind

    maybe you wish to look at your sheet again from post #7 and rewrite your instructions with less specific columns and more so something like:
    where it says "SALE NO SDCI+" i need that and the column to the right of it moved to the field11_name column?

    because i asked if there would be combinations such as "Fare Method Marker" and "Sale Number (SDCI+)" in the same row
    you said no, but there are.
    be careful with your wording and try your first post again.
    be conscious of the position of cells overlapping and deleting previous data
    be conscious of the position of cells after "moving them all" over 2 columns.
    none of it makes sense when you start moving things around in the way you stated.

    and perhaps in a another sheet you could provide a few rows of what you expect it to look like?
    Last edited by BlakeSkate; Aug 16th, 2019 at 02:22 PM.
    -------------------------------------------------------------------------------
    I may not give the best VBA codes, but they sure are VBA codes.
    Help me help you by posting a snapshot of your data & your expected result
    Please use [ code][ /code] tags when posting VBA as well as proper indentation

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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