PDA

View Full Version : Copy/paste macro



doiknow
23-02-2009, 10:17 PM
Hello.

I need to get a spreadsheet properly formated to use as a cvs file.

I have a series of columns that contain engine sizes that I need to attach to the end of a string on the same row. Each row contains a different number of sizes.

So for this data:
A-----B---C---D---E
hello|-1.2-1.6-1.6t-Q4
bye|--1.1-2.4

I would like to return:

A
hello|1.2
hello|1.6
hello|1.6t
hello|Q4
bye|1.1
bye|2.4

dugimodo
24-02-2009, 12:38 AM
not a macro exactly, you can use the concantenate function or the simplified verision with ampersand ( & )

e.g. If A1 contains "Hello" and B1 contains 1.2 this formula =A1&B1 would give you Hello1.2

You can add extra text such as a space like this =A1&" "&B1 giving Hello 1.2

use excels help function for a detail decription of Concantenate and "&"

doiknow
24-02-2009, 12:48 AM
I've already tried that route.

Its almost as slow as simply copy/pasting it manually.

I have in the region of 5000 records to add multiple additions to.
Automation is pretty much a requirement!

doiknow
24-02-2009, 12:58 AM
No wait - I tried fiddling with it again and found a different approach.
Its not macro quick but its fast enough to be pratical.

Thanks for pointing out the obious. (sorry for the spelling)