Re: Split or copy records n-times as excel scans the value of a colum

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Sub AAA()
Dim i As Long, Num As Long
i = 1
Do While Cells(i, 1) <> ""
Num = Cells(i, 1)
Cells(i, 1).Offset(1, 0).Resize(Num).EntireRow.Insert
Set rng = Cells(i, 1).Offset(1, 0).Resize(Num)
Cells(i, 1).EntireRow.Copy Destination:=rng
i = i + Num + 1
Loop
End Sub

--
Regards,
Tom Ogilvy

"Loops" <Loops@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EE838AF0-D20B-4218-87C9-243AC92D70E2@xxxxxxxxxxxxxxxx
> I would like to split or copy record n-times based on n-value on of a row.
> How do you contruct the loop?
>


.



Relevant Pages

  • Interesting behaviour with lexical variable
    ... use warnings; ... I found out that once the loop get executed for the second ... sub main { ... Variable "$num" will not stay shared at x.pl line 11. ...
    (comp.lang.perl.misc)
  • Re: AutoFill Loop
    ... Sub PB_Get_Nums ... change F2 to the correct cell. ... > follow you logic on the loop and the code does loop properly, ... >> Tom Ogilvy ...
    (microsoft.public.excel.programming)
  • Re: Offset
    ... Sub AAA ... Loop Until IsEmpty) ... Tom Ogilvy ... I would like to Goto U1 Then Find and select the last cell in column U ...
    (microsoft.public.excel.programming)
  • Re: Interesting behaviour with lexical variable
    ... Note that $num in the loop is *not* the same variable each time, ... The named sub addfirmly believes ... I wouldn't think that a closure knows about the changes. ...
    (comp.lang.perl.misc)
  • Re: Interesting behaviour with lexical variable
    ... my $num = abs $input; ... function inside a loop or another function. ... The sub addis defined at compile time, ...
    (comp.lang.perl.misc)