Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Enter formulas in a certain number of rows, based on a cell value

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Enter formulas in a certain number of rows, based on a cell va

Works perfectly. Once again, thanks for your help. This is the third or
fourth time that you have come through for me.


"Tom Ogilvy" wrote:

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

Reply
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
Sum Number of Rows based on Value in Another Cell Dickie Worton Excel Worksheet Functions 2 November 30th 09 02:52 PM
Is there a way to hide worksheets and/or rows/columns based on information enter into a particular cell of range of cells? Marc New Users to Excel 1 March 10th 06 05:10 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


All times are GMT +1. The time now is 01:14 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"