Thread: fill series
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
reneets reneets is offline
external usenet poster
 
Posts: 10
Default fill series

Thanks for the link, I really need to bone up on my VBA

"Gord Dibben" wrote:

reneets

VBA macro can do it in one step.

Makes a copy of the worksheet first and inserts the blank rows on that sheet.

Sub InsertRow_At_Change()
Dim i As Long
With Application
.Calculation = xlManual
.ScreenUpdating = False
End With
ActiveSheet.Copy Befo=Sheets(1)
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 1) < Cells(i, 1) Then _
Cells(i, 1).Resize(9, 1).EntireRow.Insert
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP



On Wed, 21 Mar 2007 08:34:02 -0700, reneets
wrote:

This works, however, I get a "selection to large" error. So I have to do
this in smaller increments. I appreciate your help.

"RagDyeR" wrote:

Say datalist is on Sheet1.

You want first cell of data (A1) copied to, say B1 of new sheet.
Second cell of data (A2) copied to B10 of new sheet (8 empty rows between 1
and 10).

Try this in B1 - (can be entered *anywhere*, not necessarily B1):

=INDEX(Sheet1!$A$1:$A$1014,ROWS($1:9)/9)

NOW ... select B1 *TO* B9 (with rows 2 to 9 empty).

Click on the fill handle of this *9 row selection*, and drag down as needed.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"reneets" wrote in message
...
I have a worksheet tab that has 1014 rows of data numbered 1 - 1014 in
column
A. I need to create another tab (within the workbook) that will take the
numbered row data from column A of the tab with the 1014 rows of data and
inserting 8 rows between each number. What is the best way to accomplish
this.