Tech Support Guy banner
  • Please post in our Community Feedback thread for help with the new forum software! If you are having trouble logging in, please Contact Us for assistance.
Status
Not open for further replies.
1 - 6 of 6 Posts

·
Registered
Joined
·
562 Posts
Discussion Starter · #1 ·
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?
 

·
Registered
Joined
·
562 Posts
Discussion Starter · #3 ·
He just said that he couuldn't get the areas copied and pasted to a new sheet. Sorry, don't know any more than that.

I got the impression that he could copy one area at a time and paste but couldn't do all of the areas at once.

Again, I'm not savy enough to "splain" more than that.
 

·
Registered
Joined
·
4,916 Posts
I'm still confused by your description. Is is possible to post a sample workbook showing the data before and after the macro is run?

FYI, you cannot copy multiple ranges of non-continous cells in Excel unless you use code. I have code that is very similar to what you want but I need to understand what you are trying to do before I can tweak it for you.

Rollin
 

·
Registered
Joined
·
19,896 Posts
He can record the macro of copying and pasting the areas seperately, he doesn't need to do them all in one go. He should just record what he normally does each week.
 

·
Registered
Joined
·
2,702 Posts
>> I can create a macro but this is out of my league.

Everything Rollin & OBP told you is correct. Just some additional advice -- if you use the macro recorder, you'll like as not get loads of stuff you don't actually need. Recording, I got:

Sub Macro1()
Range("D7:F18").Select
Selection.Copy
Range("H1").Select
ActiveSheet.Paste
End Sub


This can be pruned to just:

Sub Macro2()
Range("D7:F18").Copy Range("H1")
End Sub


or (if the paste area is on a different sheet):

Sub Macro3()
Range("D7:F18").Copy Range("Sheet2!H1")
End Sub


HTH,
Andy
 
1 - 6 of 6 Posts
Status
Not open for further replies.
Top