View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
[email protected] jonathandore2@gmail.com is offline
external usenet poster
 
Posts: 2
Default Insert Rows Below

On Wednesday, June 6, 2012 at 1:00:39 PM UTC+1, Bob Flanagan wrote:
The following code will do what you want:

Sub InsertRowsBelow()
Dim anyR As Range
Set anyR = Selection.SpecialCells(xlVisible)
Selection.SpecialCells(xlVisible).Offset(1, 0).EntireRow.Insert
anyR.Offset(1, 0).Select
End Sub

If you don't need to select the new rows, then all you need is

Selection.SpecialCells(xlVisible).Offset(1, 0).EntireRow.Insert

You can place the above in yoru personal.xlsx workbook and when you
need to run, just press ALT-F8 and select it.

Robert Flanagan
Add-ins.com LLC
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


On Jun 5, 1:54*pm, GS wrote:
It happens that ExcelUser73 formulated :

Hello,
I'm trying to insert rows below a row. *I first run a filter so that
some rows are showing then I want to insert new rows after each row that
is showing. I need to manually insert a variable number of rows after
each row that is showing.
I used to be able to use the "Insert Row Below" option in the older
version of Excel, but this version seems like it doesn't have it?
Thanks in advance for your help


Like everyone else states, I've never seen such an option in Excel. It
certainly would be nice if there was one, though!

<FWIW
I include a utility in all my addins that gives users the option (from
the right-click menu) to insert rows above or below the active row, OR
left or right of the active column. A prompt to enter the number of
rows/cols (default=1) appears and the deed is done! Perhaps you could
include something similar.

(The popup menu also has an option to insert more rows/cols to extend
the end of a pre-defined table. Same prompt for how many to insert.)

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup!
* * comp.lang.basic.visual.misc
* * microsoft.public.vb.general.discussion


Bob, your macro works beautifully, thanks! Astonishing that this simple functionality should be available in a Word table, but not in Excel. Although no one in this thread had come across it on older versions of Excel, it seems the OP was correct in saying it used to be available: see https://support.office.com/en-us/art...b-71cb4e5d3e16 (under "Insert a table row or column", point 3).