Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to insert the number of rows that corresponds with a number in an
existing column. For example: My number at B2 is 3 so I would need to insert three rows immediately after row 2. My goal would be to have three rows with the identical information from Row 2 in rows 3,4 and 5. Is this possible? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Anything's possible. ;)
What I would do: Sub insertrowhere() Dim cell As Range Set cell = Range("B2") For i = 1 To cell.Value cell.Offset(1, 0).EntireRow.Insert cell.EntireRow.Copy Destination:=cell.Offset(1, 0).EntireRow Next i End Sub You can set cell however you want and go from there. Hope this helps! -- -SA "suestew" wrote: I need to insert the number of rows that corresponds with a number in an existing column. For example: My number at B2 is 3 so I would need to insert three rows immediately after row 2. My goal would be to have three rows with the identical information from Row 2 in rows 3,4 and 5. Is this possible? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! Where do I input the data you've sent me. I'm only slightly
familiar with macros. I really apprecaite your help. Is there any chance you can call me and walk me through it? "StumpedAgain" wrote: Anything's possible. ;) What I would do: Sub insertrowhere() Dim cell As Range Set cell = Range("B2") For i = 1 To cell.Value cell.Offset(1, 0).EntireRow.Insert cell.EntireRow.Copy Destination:=cell.Offset(1, 0).EntireRow Next i End Sub You can set cell however you want and go from there. Hope this helps! -- -SA "suestew" wrote: I need to insert the number of rows that corresponds with a number in an existing column. For example: My number at B2 is 3 so I would need to insert three rows immediately after row 2. My goal would be to have three rows with the identical information from Row 2 in rows 3,4 and 5. Is this possible? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No problem. It's not too hard to run macros. I would say the problem you'll
probably run into if you're not too familiar with them is in setting "cell" (especially if you want to do this on more than just "B2"). The following is a short explaination on what you need to do. If you need more help, I'd be willing to call you (if you're in the states) this afternoon some time. Good luck! Copy the Code Alt+F11 to start the VB Editor InsertModule Paste code into white pane that appears Alt+F11 to return to Excel To use Select monthly (template) sheet Alt+F8 to bring up Macros Highlight the macro name Run -- -SA "suestew" wrote: Thanks! Where do I input the data you've sent me. I'm only slightly familiar with macros. I really apprecaite your help. Is there any chance you can call me and walk me through it? "StumpedAgain" wrote: Anything's possible. ;) What I would do: Sub insertrowhere() Dim cell As Range Set cell = Range("B2") For i = 1 To cell.Value cell.Offset(1, 0).EntireRow.Insert cell.EntireRow.Copy Destination:=cell.Offset(1, 0).EntireRow Next i End Sub You can set cell however you want and go from there. Hope this helps! -- -SA "suestew" wrote: I need to insert the number of rows that corresponds with a number in an existing column. For example: My number at B2 is 3 so I would need to insert three rows immediately after row 2. My goal would be to have three rows with the identical information from Row 2 in rows 3,4 and 5. Is this possible? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops! Slight change on the instructions (I copied/pasted from a different
post). Copy the Code Alt+F11 to start the VB Editor InsertModule Paste code into white pane that appears Alt+F11 to return to Excel To use *Select the sheet on which you want to run the macro* Alt+F8 to bring up Macros Highlight the macro name Run :) -- -SA "suestew" wrote: Thanks! Where do I input the data you've sent me. I'm only slightly familiar with macros. I really apprecaite your help. Is there any chance you can call me and walk me through it? "StumpedAgain" wrote: Anything's possible. ;) What I would do: Sub insertrowhere() Dim cell As Range Set cell = Range("B2") For i = 1 To cell.Value cell.Offset(1, 0).EntireRow.Insert cell.EntireRow.Copy Destination:=cell.Offset(1, 0).EntireRow Next i End Sub You can set cell however you want and go from there. Hope this helps! -- -SA "suestew" wrote: I need to insert the number of rows that corresponds with a number in an existing column. For example: My number at B2 is 3 so I would need to insert three rows immediately after row 2. My goal would be to have three rows with the identical information from Row 2 in rows 3,4 and 5. Is this possible? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. I'll give it a try. If I have problems, I will let you know.
"StumpedAgain" wrote: Oops! Slight change on the instructions (I copied/pasted from a different post). Copy the Code Alt+F11 to start the VB Editor InsertModule Paste code into white pane that appears Alt+F11 to return to Excel To use *Select the sheet on which you want to run the macro* Alt+F8 to bring up Macros Highlight the macro name Run :) -- -SA "suestew" wrote: Thanks! Where do I input the data you've sent me. I'm only slightly familiar with macros. I really apprecaite your help. Is there any chance you can call me and walk me through it? "StumpedAgain" wrote: Anything's possible. ;) What I would do: Sub insertrowhere() Dim cell As Range Set cell = Range("B2") For i = 1 To cell.Value cell.Offset(1, 0).EntireRow.Insert cell.EntireRow.Copy Destination:=cell.Offset(1, 0).EntireRow Next i End Sub You can set cell however you want and go from there. Hope this helps! -- -SA "suestew" wrote: I need to insert the number of rows that corresponds with a number in an existing column. For example: My number at B2 is 3 so I would need to insert three rows immediately after row 2. My goal would be to have three rows with the identical information from Row 2 in rows 3,4 and 5. Is this possible? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your plan worked like magic until row 727. Why? I have more rows.
"StumpedAgain" wrote: Oops! Slight change on the instructions (I copied/pasted from a different post). Copy the Code Alt+F11 to start the VB Editor InsertModule Paste code into white pane that appears Alt+F11 to return to Excel To use *Select the sheet on which you want to run the macro* Alt+F8 to bring up Macros Highlight the macro name Run :) -- -SA "suestew" wrote: Thanks! Where do I input the data you've sent me. I'm only slightly familiar with macros. I really apprecaite your help. Is there any chance you can call me and walk me through it? "StumpedAgain" wrote: Anything's possible. ;) What I would do: Sub insertrowhere() Dim cell As Range Set cell = Range("B2") For i = 1 To cell.Value cell.Offset(1, 0).EntireRow.Insert cell.EntireRow.Copy Destination:=cell.Offset(1, 0).EntireRow Next i End Sub You can set cell however you want and go from there. Hope this helps! -- -SA "suestew" wrote: I need to insert the number of rows that corresponds with a number in an existing column. For example: My number at B2 is 3 so I would need to insert three rows immediately after row 2. My goal would be to have three rows with the identical information from Row 2 in rows 3,4 and 5. Is this possible? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You'll have to be more specific. What's different about row 727 or 728? Are
you moving on to another portion that needs to be copied down? -- -SA "suestew" wrote: Your plan worked like magic until row 727. Why? I have more rows. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting rows inbetween rows of data ? | Excel Discussion (Misc queries) | |||
Copying & Inserting Rows w/o Affecting other Rows Etc. | Excel Worksheet Functions | |||
Inserting Blank rows after every row upto 2500 rows | Excel Worksheet Functions | |||
Inserting multiple rows in excel with data in consecutive rows | Excel Programming | |||
Auto Filter Delete Rows by Criteria Doesn't Work Range To Complicated | Excel Programming |