Macro to copy concatenated info from one workbook, de-concatenating, and pasting into another workbook

Raceman

Board Regular
Joined
Mar 11, 2010
Messages
64
Hi, I need a macro button that I can click to add information from a cell in a different Workbook, based on 2 common numbers (called D No.and Z No. ). The info in the cell that I want to copy has been concatenated. The concatenated info is in the form of 5 digit numbers each separated by a space. There could be from 0 to 20 5-digit numbers in this cell that have been concatenated and separated by a space.

The details:
The macro code button would reside in the active workbook called "Order" and the workbook I want to get the information from (the 5 digit no.s) is in the Wrkbook called "LOG". The VBA code would have to copy the 5 digit no's that have been concatenated in column E (in "LOG"), then de-concatenate (if that's a real word) the 5-digit no's , so they can be copied into "Order" as individual 5-digit no's starting in A19:C19 and going down to A25:C25 (but I'm limited to only the first seven 5-digit numbers ). To make matters worse, these 5 digit no.s need an "IN" put in front of them. So for example if there were only two 5-digit no's concatenated in "LOG" the end result in "Order" A19:C19 could be IN55555, and in A20:C20, IN55556.

The macro code knows which cell to get this information from in column E (in "LOG") by matching 2 conditions exactly. In "LOG" the D No. is in Column A and Z No. is in Column B. In the "Order" Workbook (which is the active workbook) the D No. is in K5 and the Z No. is in D4:E4. Is this possible, or is it way too complex?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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