I'm looking for some code to create 12 rows above (or below, whichever is easier) a selected row, then copy 12 rows from another sheet and paste them into the rows just created.
I'm looking for some code to create 12 rows above (or below, whichever is easier) a selected row, then copy 12 rows from another sheet and paste them into the rows just created.
Ok I've attached a sample of what my workbook looks like. On sheet 1 there are 6 similar sections, one for each of 6 different dogs. When I need to add a new dog, I want a macro that will create 12 rows above the selected row (in my real workbook there are a few hundred dogs in alphabetical order) and then copy/paste rows 5 through 16 from sheet 2 into those new rows.
Any help on this? Seems like it would be pretty simple.
Pretty basic recorded macro that might work, select line where you want to insert, then run macro.
I am sure someone else around here has a better idea but may work for now![]()
Please Login or Register to view this content.
Last edited by sparky101747; 02-22-2011 at 02:03 PM. Reason: Took out offset
I got that to work somewhat, but unfortunately it doesn't size everything correctly. When I do this process manually, I have to do it a certain way or the rows are the wrong size. Here is my process:
1. Select a cell in the first row of a section (say... row 29 in my sample)
2. Hit Alt + I + R, then F4 to repeat it 11 more times
3. Go over to my section template on the other sheet
4. Select rows 5 through 16 (it has to be the entire row or it doesn't paste correctly)
5. Go back to the original sheet
6. Select the first cell of the first newly created row
7. Paste
If i do it any other way, some of the rows are the wrong size.
It worked fine for me, but I click on the number 29 to select that row not the cell. Try that and see if it works. Here's your sample with the macro (macro2) that I used.
Last edited by sparky101747; 02-23-2011 at 11:34 AM.
Hmm, ok now I'm getting it to work just fine after doing what you said. But a new problem I'm having is conditional formatting not working for the boarding in and boarding out columns in a freshly pasted section. The conditional formats are there and they look correct, but nothing happens when I enter today's date. If I make a new conditional format with the same conditions it works fine. Dunno what's going on.
Bump, still have this problem
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks