Excel macro

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
thewolfe
DBB Admiral
DBB Admiral
Posts: 1987
Joined: Tue Nov 05, 2002 3:01 am
Contact:

Excel macro

Post by thewolfe »

Excel macro

A friend has a spread sheet he receives every week. He has to copy info from that sheet and past it into a new Excel sheet in a different order and then save the new sheet as a "prn" file.

He wants to create a macro (or two) that will do as much of the following as possible.

The following cells are always the same.

He wants to copy the following cells and then paste each cell area below the previously pasted cell area with one blank cell between each cell area.

The "pasted" info is then saved as a "prn" file.

Here's the cell info he's coping.

D7-F18
D21-F32
H7-J18
H21-J32
L7-N18
L21-N32

I can create a macro but this is out of my league.
Questions? Solutions?
User avatar
CDN_Merlin
DBB_Master
DBB_Master
Posts: 9781
Joined: Thu Nov 05, 1998 12:01 pm
Location: Capital Of Canada

Post by CDN_Merlin »

Isn't a macro just a simple script that does exactly what you do? Like have him start recording, then do the steps in order of what he wants and then stop the macro and save it.
User avatar
thewolfe
DBB Admiral
DBB Admiral
Posts: 1987
Joined: Tue Nov 05, 2002 3:01 am
Contact:

Post by thewolfe »

I believe one of the problems is you can only copy one cell area at a time.
User avatar
snoopy
DBB Benefactor
DBB Benefactor
Posts: 4435
Joined: Thu Sep 02, 1999 2:01 am

Post by snoopy »

Well, it would make for a long recording... but why not do it all one at a time- once the macro is recorded it'll all happen so fast he won't be able to tell the difference, it will just take a while...
User avatar
thewolfe
DBB Admiral
DBB Admiral
Posts: 1987
Joined: Tue Nov 05, 2002 3:01 am
Contact:

Post by thewolfe »

See above
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6459
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

guh. too lazy to do the work?

you only have to record it ONCE.

but anyways, you could just insert the rows first, then copy it.
User avatar
thewolfe
DBB Admiral
DBB Admiral
Posts: 1987
Joined: Tue Nov 05, 2002 3:01 am
Contact:

Post by thewolfe »

Sorry I don't understand. Record what once?

Insert the (what) rows first then copy it(Where)?
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

You can hit the Record button, do all the manipulation, then hit the Stop Recording button and save it as a macro. Done.
User avatar
CDN_Merlin
DBB_Master
DBB_Master
Posts: 9781
Joined: Thu Nov 05, 1998 12:01 pm
Location: Capital Of Canada

Post by CDN_Merlin »

Start recordgin the macro.

do all the steps required for what he needs, copy, paste, move, add etc. Then stop the macro and name it.

Next time he needs it, open the spreadsheet and run that macro and it will get down within seconds.
User avatar
thewolfe
DBB Admiral
DBB Admiral
Posts: 1987
Joined: Tue Nov 05, 2002 3:01 am
Contact:

Post by thewolfe »

As I have stated before, it is my understanding that you can only copy one cell area at a time.

If you copy one cell area and go to the next cell area and copy it, it only saves the last copied cell area. So....you can't hit Record, go through coping 6 different cell areas and then go to another sheet, paste them and click stop.
Post Reply