oshkoshbagoshh

alternaterows

Aug 18th, 2017
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '*******************************************************************************
  2. ' This code will insert a row after every row in the selection
  3. '       --Note: can modify for every column instead of row
  4. '                           ~ AJ Javadi ~
  5. '*******************************************************************************
  6.  
  7. Option Explicit
  8.  
  9. Sub InsrtAlternateRows()
  10.  
  11. Dim rng As Range
  12.  
  13. Dim CountRow As Integer
  14.  
  15. Dim i As Integer
  16.  
  17. Set rng = Selection
  18.  
  19. CountRow = rng.EntireRow.Count
  20.  
  21. For i = 1 To CountRow
  22.  
  23.     ActiveCell.EntireRow.Insert
  24.    
  25.     ActiveCell.Offset(2, 0).Select
  26.    
  27. Next i
  28.  
  29.    
  30. End Sub
Advertisement
Add Comment
Please, Sign In to add comment