View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tribbleorlfl tribbleorlfl is offline
external usenet poster
 
Posts: 1
Default Copying and pasting a range x times based on user-defined value of x


I posted this in the members section, but haven't received a solution
to my problem yet.

Essentially I have a problem where I have a row with some user inputs
and formulas that calculate based on those user inputs. There is
another user input field (on another sheet) where they enter in a number
("x").

I'm trying to create a macro that will paste that row with formulas "x"
times based on the user-defined value of the "x" field.

In other words, if the user types in 40 in the user field, the macro
pastes the row with formulas 39 times (since the row being copied
already exists) below the existing row. The value for this field will
be variable each time the user opens and uses this workbook.

any idea how to make this work? Originally I was going the route of
having the row pre-copied say 200 times (since I don't anticipate the
user-defined value of "x" exceeding 200) and then developing a macro
that would hide the unneeded rows (in other words, if the user entered
40 for "x", the bottom 160 rows would be hidden), but it has been
suggested that is inefficient.


--
tribbleorlfl
------------------------------------------------------------------------
tribbleorlfl's Profile: 1535
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=183964

Microsoft Office Help