Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50068

[SOLVED] Cut 'n' Paste Multiple Rows Macro

$
0
0
Hello, I am running Excel 2010 on Windows 7 (64-bit).

Please find attached my Excel 2010 workbook named: Book5. (all data contained within this workbook is fake).

I have highlighted several cells in both red and yellow background colors to make it easier for people to follow what I need to do.

I am trying to create a macro to do the following:

Example 1:

the data of cell A3: …Mother speaks Italian only.
--- this data is preceded with ... (3-dots). It needs to be cut 'n' pasted into cell Y2.
the data of cell A4: …Father has hearing aids.
--- this data is preceded with ... (3-dots). It needs to be cut 'n' pasted into cell Y2.
the data of cell A5: …Spouse is looking after 3 children under 3-years old.
--- this data is preceded with ... (3-dots). It needs to be cut 'n' pasted into cell Y2.

The data needs to be added to the existing data in cell Y2.

So, after all the data has been cut 'n' pasted in to cell Y2, then cell Y2 should read: Mother overseas for period 25 Jun - 26 Jul 12 with Father. ...Mother speaks Italian only. ...Father has hearing aids. ...Spouse is looking after 3 children under 3-years old.

Adjacent to cell A5 is cell B5. It contains a mobile number: MOBI 0254 664 108
It needs to be cut 'n' pasted into cell Z2.

The following example (Example 2) is similar to Example 1 in that multiple rows of data in Column A that are prefixed by 3-dots need to be cut 'n' pasted in Column Y.

Example 2:

the data of cell A18: …PO BOX 1234
--- this data is preceded with ... (3-dots). It needs to be cut 'n' pasted into cell Y17.
the data of cell A19: …DAMFORD
--- this data is preceded with ... (3-dots). It needs to be cut 'n' pasted into cell Y17.
the data of cell A20: …PERTH
--- this data is preceded with ... (3-dots). It needs to be cut 'n' pasted into cell Y17.
the data of cell A21: …WA 6001
--- this data is preceded with ... (3-dots). It needs to be cut 'n' pasted into cell Y17.

The data needs to be added to the existing data in cell Y17.

So, after all the data has been cut 'n' pasted in to cell Y17, then cell Y17 should read: (NO LETTER BOX) ...PO BOX 1234 ...DAMFORD ...PERTH ...WA 6001.

The macro needs to seek all data in column A that is prefixed with 3-dots and cut 'n' paste the data into Column Y as outlined in the above examples.

So any data in Column B that is prefixed by either:

MOBI
BUSN
HOME


needs to be cut 'n' pasted in to Column Z as outlined in the above 2 examples.

Normally, I could easily do this myself, however I have over 75,000 rows to validate.

The maximum number of rows in column A is: 150,000

If anyone would be so kind as to help me, it would be greatly appreciated.

Kind regards,

Chris :)
Attached Files

Viewing all articles
Browse latest Browse all 50068

Trending Articles