Inserting Rows after Input Box is used

  • Thread starter Thread starter foamfollower
  • Start date Start date
F

foamfollower

Hello,
My latest issue is this:
Let's say there is a list of numbers in cells A1:A100. These numbers
are 1-10, in groups of 10. example: cells A1:A10 all contain 1, cells
A11:A20 all contain 2, and on up to 10.
I will need to insert 10 more rows according to whatever number is
entered into an Input Box or the like.
the user will click button to 'insert retest', then Input Box shows to
ask
what 'number' was retested, the user enters the number (say 5), then
10
rows are automatically inserted after the last number 5 in the range.

sounded like easy navigation manipulation in my head...but i'm still
new at this. Any help from the Masters is greatly appreciated.

SF
 
Hi

have a look at the following. It should help. Note that every time new rows are inserted, the range to look for the number will change.

Tony

Sub ccc()
req = InputBox("what number was retested", , 2)
Range("a1:a100").Find(req).Offset(10, 0).Select
Rows(ActiveCell.Row & ":" & ActiveCell.Row + 9).Select
Selection.Insert Shift:=xlDown
End Sub
----- foamfollower wrote: -----

Hello,
My latest issue is this:
Let's say there is a list of numbers in cells A1:A100. These numbers
are 1-10, in groups of 10. example: cells A1:A10 all contain 1, cells
A11:A20 all contain 2, and on up to 10.
I will need to insert 10 more rows according to whatever number is
entered into an Input Box or the like.
the user will click button to 'insert retest', then Input Box shows to
ask
what 'number' was retested, the user enters the number (say 5), then
10
rows are automatically inserted after the last number 5 in the range.

sounded like easy navigation manipulation in my head...but i'm still
new at this. Any help from the Masters is greatly appreciated.

SF
 
Back
Top