#1   Report Post  
Posted to microsoft.public.excel.misc
b166er
 
Posts: n/a
Default urgent help


hi members
how can I insert rows after every fiftth row I have data of more than
6000 rows that means I want to insert 2000 rows in that sequence


--
b166er
------------------------------------------------------------------------
b166er's Profile: http://www.excelforum.com/member.php...o&userid=34912
View this thread: http://www.excelforum.com/showthread...hreadid=554563

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default urgent help

Don't multi-post.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"b166er" wrote in
message ...

hi members
how can I insert rows after every fiftth row I have data of more than
6000 rows that means I want to insert 2000 rows in that sequence


--
b166er
------------------------------------------------------------------------
b166er's Profile:

http://www.excelforum.com/member.php...o&userid=34912
View this thread: http://www.excelforum.com/showthread...hreadid=554563



  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default urgent help

I've tested the code and it worked okay, but make a back up copy of your
workbook just in case. The macro assumes that the data is on Sheet1 of the
workbook and starts in column A1.

Press Alt+F11 to open VBE. Click on INSERT in the VBE menu and select
MODULE. Copy and paste the code below into the module. close the VBE and in
Excel click TOOLS, select MACROS, select MACRO, highlight the macro
InsertMoreRows and click the run button.

Sub InsertMoreRows()

Dim wb As Workbook
Dim ws As Worksheet
Dim lngRowCounter As Long
Dim lngOffset As Long
Set wb = ActiveWorkbook
Set ws = wb.Worksheets("Sheet1")

ws.Activate
Range("A1").Select

Do Until lngRowCounter = 2000
lngOffset = lngOffset + 5
ActiveCell.Offset(lngOffset).EntireRow.Insert
lngRowCounter = lngRowCounter + 1
Loop

Set ws = Nothing
Set wb = Nothing

End Sub

--
Kevin Backmann


"b166er" wrote:


hi members
how can I insert rows after every fiftth row I have data of more than
6000 rows that means I want to insert 2000 rows in that sequence


--
b166er
------------------------------------------------------------------------
b166er's Profile: http://www.excelforum.com/member.php...o&userid=34912
View this thread: http://www.excelforum.com/showthread...hreadid=554563


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
VB script in Excel object in Powerpoint (Urgent) epak Excel Discussion (Misc queries) 1 March 24th 06 05:04 PM
URGENT !! Auto Filter Nirakar Excel Discussion (Misc queries) 1 February 7th 06 08:56 PM
Excel table to Word help needed!!! Urgent. Irn Bru Freak Excel Discussion (Misc queries) 2 February 3rd 06 07:04 PM
"Urgent" use script to share the workbook man Excel Discussion (Misc queries) 1 August 17th 05 02:09 PM
Urgent Urgent Urgent!!! Ruslan Excel Discussion (Misc queries) 6 March 30th 05 02:59 PM


All times are GMT +1. The time now is 04:46 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"