oshkoshbagoshh

insrtXrows

Aug 18th, 2017
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '************************************************************************
  2. '  Tell the box how many rows you want to insert
  3. '                   ~~ AJ ~~
  4. '*************************************************************************
  5.  
  6. Sub InsertMultipleRows()
  7.  
  8. Dim i As Integer
  9. Dim j As Integer
  10.  
  11. ActiveCell.EntireRow.Select
  12.  
  13. On Error GoTo Last
  14.  
  15. i = InputBox("Number of rows to insert", "Insert Rows")
  16.  
  17. For j = 1 To i
  18.  
  19. Selection.Insert Shift:=xlToDown, CopyOrigin:=xlFormatFromRightorAbove
  20.  
  21. Next j
  22. Last:
  23. Exit Sub
  24. End Sub
Advertisement
Add Comment
Please, Sign In to add comment