Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default inserting three rows

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default inserting three rows

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

" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default inserting three rows

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


"Mike H" wrote:

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

" wrote:

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default inserting three rows


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


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




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
inserting rows inbetween rows of data ? Azeem Excel Discussion (Misc queries) 1 October 27th 09 07:38 AM
Copying & Inserting Rows w/o Affecting other Rows Etc. LRay67 Excel Worksheet Functions 1 October 22nd 08 02:10 AM
Inserting Blank rows after every row upto 2500 rows Manju Excel Worksheet Functions 8 August 22nd 06 12:54 PM
Why is inserting rows throwing off my hidden rows jgeniti[_2_] Excel Programming 4 March 9th 06 11:25 PM
Inserting multiple rows in excel with data in consecutive rows technotronic Excel Programming 2 October 20th 05 03:12 PM


All times are GMT +1. The time now is 02:39 PM.

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"