View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Enter formulas in a certain number of rows, based on a cell value

Sub AAA()
Dim num As Variant, rng As Range
num = InputBox("enter number of new rows")
If num = "" Then Exit Sub
If Not IsNumeric(num) Then Exit Sub
Set rng = Cells(Rows.Count, 1).End(xlUp)(2).EntireRow
Set rng = rng.Resize(num)
Rows(2).Copy rng
End Sub

--
Regards,
Tom Ogilvy

"jeffbert" wrote:

I have a new item worksheet set up, for buyers to properly enter all of the
information needed to set up new sku's in our system. What I would like to
do, is have them enter the number of new items they are setting up, and then
have Excel copy all of the formulas in row 2 and paste them into the exact
number of rows equal to the number of items they are setting up.

Example:

# of sku's being set up = 15
Copy row 2 and paste it into the 15 contiguous rows from 2 thru 14