Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB script in Excel object in Powerpoint (Urgent) | Excel Discussion (Misc queries) | |||
URGENT !! Auto Filter | Excel Discussion (Misc queries) | |||
Excel table to Word help needed!!! Urgent. | Excel Discussion (Misc queries) | |||
"Urgent" use script to share the workbook | Excel Discussion (Misc queries) | |||
Urgent Urgent Urgent!!! | Excel Discussion (Misc queries) |