Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GM GM is offline
external usenet poster
 
Posts: 23
Default How do I create macro to add 8 rows at a time?

I have a worksheet with data that I need to insert 8 rows inbetween the other
rows in a spreadsheet. I tried creating a Macro but it records the cell
reference and just adds 8 rows at the same spot.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 209
Default How do I create macro to add 8 rows at a time?

Range(ActiveCell.Address & ":" & _
ActiveCell.Offset(7, 0).Address).Insert _
Shift:=xlDown
will insert 8 rows starting at the cursor.
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"GM" wrote:

I have a worksheet with data that I need to insert 8 rows inbetween the other
rows in a spreadsheet. I tried creating a Macro but it records the cell
reference and just adds 8 rows at the same spot.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 192
Default How do I create macro to add 8 rows at a time?

My guess is that you're only inserting a row for a particular cell. Try this:

Range("B5").EntireRow.Insert shift:=xlDown
--
-SA


"GM" wrote:

I have a worksheet with data that I need to insert 8 rows inbetween the other
rows in a spreadsheet. I tried creating a Macro but it records the cell
reference and just adds 8 rows at the same spot.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 209
Default How do I create macro to add 8 rows at a time?

You're absolutely right! Insert rows example below...

Range(ActiveCell.Row() & ":" & _
ActiveCell.Offset(7, 0).Row).Insert _
Shift:=xlDown

--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"StumpedAgain" wrote:

My guess is that you're only inserting a row for a particular cell. Try this:

Range("B5").EntireRow.Insert shift:=xlDown
--
-SA


"GM" wrote:

I have a worksheet with data that I need to insert 8 rows inbetween the other
rows in a spreadsheet. I tried creating a Macro but it records the cell
reference and just adds 8 rows at the same spot.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default How do I create macro to add 8 rows at a time?

GM wrote:
I have a worksheet with data that I need to insert 8 rows inbetween the other
rows in a spreadsheet. I tried creating a Macro but it records the cell
reference and just adds 8 rows at the same spot.


From the help file...

If you want the macro to run relative to the position of the active cell, record
it using relative cell references. On the Stop Recording toolbar, click Relative
Reference so that it is selected. Excel will continue to record macros with
relative references until you quit Excel or until you click Relative Reference
again, so that it is not selected.



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
How to create a macro to delete multiple rows? gak27 Excel Discussion (Misc queries) 4 December 28th 07 04:51 PM
Create a macro to delete rows if value is less than a specified nu QE Excel Worksheet Functions 5 July 27th 06 08:35 PM
how do I create a macro to auto insert rows? aashish Excel Worksheet Functions 1 January 30th 06 11:49 PM
Create a Macro that will copy the rows that have a value < 0 wil4d Excel Discussion (Misc queries) 1 December 18th 05 05:28 PM
HOW DO I CREATE A MACRO TO STRIP OUT ROWS? Bluenose Excel Discussion (Misc queries) 2 May 25th 05 03:23 PM


All times are GMT +1. The time now is 07:37 AM.

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"