Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding rows within a list
I have a long list with no spaces, all in one column. I am trying to add 7 blank lines in between each row. What is the easiest way to achieve this? Thanks in advance -- nihad ------------------------------------------------------------------------ nihad's Profile: http://www.excelforum.com/member.php...o&userid=30285 View this thread: http://www.excelforum.com/showthread...hreadid=515389 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding rows within a list
Hi Try the following (I named my list Test) Dim r As Object Dim intCount As Integer intCount = 1 For Each r In Range("Test") If r.Value = "" Then Else r.Offset(1, 0).Select intCount = 1 Do Until intCount 7 Selection.EntireRow.Insert intCount = intCount + 1 Loop End If Next -- BadgerM ----------------------------------------------------------------------- BadgerMK's Profile: http://www.excelforum.com/member.php...fo&userid=3140 View this thread: http://www.excelforum.com/showthread.php?threadid=51538 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding rows within a list
Hi nihad Try this macro Sub test() Application.ScreenUpdating = False Dim R As Long Dim rng As Range Set rng = ActiveSheet.UsedRange For R = rng.Rows.Count To 1 Step -1 rng.Rows(R + 1).Resize(7).EntireRow.insert Next R Application.ScreenUpdating = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "nihad" wrote in message ... I have a long list with no spaces, all in one column. I am trying to add 7 blank lines in between each row. What is the easiest way to achieve this? Thanks in advance -- nihad ------------------------------------------------------------------------ nihad's Profile: http://www.excelforum.com/member.php...o&userid=30285 View this thread: http://www.excelforum.com/showthread...hreadid=515389 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding rows within a list
Sub SpaceSeven()
Dim irow As Long For irow = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1 Rows(irow).Resize(7).Insert shift:=xlDown Next irow End Sub HTH -- AP "nihad" a écrit dans le message de ... I have a long list with no spaces, all in one column. I am trying to add 7 blank lines in between each row. What is the easiest way to achieve this? Thanks in advance -- nihad ------------------------------------------------------------------------ nihad's Profile: http://www.excelforum.com/member.php...o&userid=30285 View this thread: http://www.excelforum.com/showthread...hreadid=515389 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically extend a list when adding a new data to another list | Excel Discussion (Misc queries) | |||
Adding rows based on no of rows specified from a given position | Excel Worksheet Functions | |||
Adding five new rows every 40 rows in a spreadsheet? | Excel Discussion (Misc queries) | |||
Adding Rows offsets to working rows across two worksheets | Setting up and Configuration of Excel | |||
Adding rows to create list from DDE data | Excel Programming |