LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Insert a number rows according to a cell value

Hi all,

I am trying to insert and copy a number of rows according to a cell
value.

From the data below I would ignore all the 1's and if the number is
1, eg 4 then insert 3 rows (4-1) and copy the data, so result would

be
Londontt,4
Londontt,4
Londontt,4
Londontt,4

Orginal data below

London54 , 1
London44,1
London333,2
London77,1
London99, 5
London33,1

I can use the code below to loop.

Do Until IsEmpty(ActiveCell) = True

If ActiveCell.Value < 1 Then
ActiveCell.EntireRow.Select
active.cell.Select
Selection.Insert
GoTo Continue
End If

ActiveCell.Offset(1, 0).Select
Loop

Continue:

Thanks,

Ed
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find number & insert rows Steve Wallis Excel Programming 4 March 21st 06 05:48 PM
Insert a number of rows based on a value in a cell on active row iRocco Excel Programming 3 August 17th 05 12:34 AM
Insert a number of rows based on a value in a cell on active row iRocco Excel Discussion (Misc queries) 1 August 11th 05 06:18 AM
Insert a number of rows based on a value in a cell on active row iRocco Excel Worksheet Functions 0 August 10th 05 08:46 PM
insert 'x' number of rows??? ali Excel Programming 1 December 16th 03 09:25 PM


All times are GMT +1. The time now is 02:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"