add rows to a sheet
Try this... (Put the cursor in on the first value - 1) then run the macro
until the end.
Sub InsertingLines()
Dim Firstvalue As Integer
Dim Secondvalue As Integer
Dim Result As Integer
Dim NoofRows As Integer
Dim Number As Integer
Firstvalue = ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Secondvalue = ActiveCell.Value
Result = Secondvalue - Firstvalue
NoofRows = Result - 1
For Number = 1 To NoofRows
Selection.EntireRow.Insert
Next
Selection.End(xlDown).Select
End Sub
"alvin Kuiper" wrote:
Hi If I have this in a sheet:
1
5
8
10
15
25
27
30
What i want is a macro there can make empty rows between the number so there
come 3 empty rows between 1 and 5 and 1 empty row between 8 and 10 - and so
on, I don't know how many rows there are numbers in:
Hope some one understand and maybe also can help.
|