How do I move specific text via macro

ghrek

Active Member
Joined
Jul 29, 2005
Messages
427
[FONT=&quot]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 .[/FONT]

[FONT=&quot]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[/FONT]

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

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

[FONT=&quot]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[/FONT]

[FONT=&quot]Where it says in Column E "FARE" I need all the data from columns E onwards moved across 2 columns in same row.[/FONT]

[FONT=&quot]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[/FONT]

[FONT=&quot]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[/FONT]

[FONT=&quot]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 [/FONT]
[FONT=&quot]U & V deleting so that data from column W onwards moves back 2 rows.


Any Ideas?

Thanks[/FONT]
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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:
Upvote 0
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?code=XZB2Xc7ZEWOHhGnEWDBzQ3UYWTteB0w6HKEX
 
Upvote 0
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?code=XZB2Xc7ZEWOHhGnEWDBzQ3UYWTteB0w6HKEX

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
 
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0
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 a moderator:
Upvote 0
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:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top