jt463
IS-IT--Management
- Nov 23, 2005
- 134
The following is a macro I recorded:
Range("A1").Select
Selection.Copy
Range("C2").Select
ActiveSheet.Paste
Range("B1").Select
Application.CutCopyMode = False
Selection.Copy
Range("D2").Select
ActiveSheet.Paste
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Range("E2").Select
ActiveSheet.Paste
and so forth...
What I want to do is to create a loop where the VB will simply move to the next record on the spreadsheet (3 rows below the first copy range) and then follow the same procedure, pasting that information into the row below the row that just was just pasted.
In other words, my example is:
(Original Record)
A
1 John Doe
2 1234 Anystreet
3 Anyville, ST 12345
4 Jane Doe <----New Record Start
5 4321 Anystreet
6 Anyville, ST 54321
(Goal Record)
AA BB
1 John Doe 1234 Anystreet...
So, I would need the macro to do the copy/paste from A1 to AA1, then A2 to BB1, and so forth. Then I would need the VB to tell it that when it finishes copying from A3 to CC1 that it needs to copy A4 to "AA2"...
Then somehow loop it so that when it finishes A6 that it knows that A7 is a new record and that needs to go to AA3.
This is the only way I can think of accomplishing this so that the data can be used in a mail merge.
Any suggestions would be greatly appreciated!
Thank you.
Range("A1").Select
Selection.Copy
Range("C2").Select
ActiveSheet.Paste
Range("B1").Select
Application.CutCopyMode = False
Selection.Copy
Range("D2").Select
ActiveSheet.Paste
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Range("E2").Select
ActiveSheet.Paste
and so forth...
What I want to do is to create a loop where the VB will simply move to the next record on the spreadsheet (3 rows below the first copy range) and then follow the same procedure, pasting that information into the row below the row that just was just pasted.
In other words, my example is:
(Original Record)
A
1 John Doe
2 1234 Anystreet
3 Anyville, ST 12345
4 Jane Doe <----New Record Start
5 4321 Anystreet
6 Anyville, ST 54321
(Goal Record)
AA BB
1 John Doe 1234 Anystreet...
So, I would need the macro to do the copy/paste from A1 to AA1, then A2 to BB1, and so forth. Then I would need the VB to tell it that when it finishes copying from A3 to CC1 that it needs to copy A4 to "AA2"...
Then somehow loop it so that when it finishes A6 that it knows that A7 is a new record and that needs to go to AA3.
This is the only way I can think of accomplishing this so that the data can be used in a mail merge.
Any suggestions would be greatly appreciated!
Thank you.