inserting three rows

  • Thread starter Thread starter carlos_ray86
  • Start date Start date
C

carlos_ray86

how can I insert three rows between rows of data. right now all i have
is activecell.insert but that only inserts one row.

Dim k As Integer
Dim w As Integer
For w = 1 To 6
For k = 0 To 100
h = ((2 * (k + 1)) - 1)
Cells(h, w).Activate
ActiveCell.Insert
 
I can't see where your macro gets a value for h from but one methed of
inserting a full row would be.

Selection.EntireRow.Insert

Mike
 
Sub test()
Dim k As Integer

For k = 100 To 1 Step -1
Cells(k, 1).Resize(3, 6).Insert
Next k

End Sub


HTH,
Bernie
MS Excel MVP
 
Dim k As Integer
Dim w As Integer
For w = 1 To 6
For k = 0 To 100
h = ((2 * (k + 1)) - 1)
Cells(h, w).Activate
Rows(ActiveCell.Row & ":" & (ActiveCell.Row + 2)).Insert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top