Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Inserting Rows - Complicated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default Inserting Rows - Complicated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Inserting Rows - Complicated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default Inserting Rows - Complicated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default Inserting Rows - Complicated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Inserting Rows - Complicated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Inserting Rows - Complicated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default Inserting Rows - Complicated

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting rows inbetween rows of data ? Azeem Excel Discussion (Misc queries) 1 October 27th 09 07:38 AM
Copying & Inserting Rows w/o Affecting other Rows Etc. LRay67 Excel Worksheet Functions 1 October 22nd 08 02:10 AM
Inserting Blank rows after every row upto 2500 rows Manju Excel Worksheet Functions 8 August 22nd 06 12:54 PM
Inserting multiple rows in excel with data in consecutive rows technotronic Excel Programming 2 October 20th 05 03:12 PM
Auto Filter Delete Rows by Criteria Doesn't Work Range To Complicated robertjtucker[_8_] Excel Programming 1 September 29th 05 05:47 PM


All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"