+ Reply to Thread
Results 1 to 3 of 3

Macro based on User input to Insert X amount of rows - Need advanced help

  1. #1
    Registered User
    Join Date
    02-27-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    25

    Macro based on User input to Insert X amount of rows - Need advanced help

    I am trying to make a macro that will:
    1. Ask the user to select a Tag number (one cell in column 5 of the ws)
    2. Then ask the user to select the amount of detail tags to add (to copy the entire row based on their input)
    3. Then take that original Tag in column 5 and Select the entire row and copy it whatever amount of times was inputted from the user on number 2 above.

    Then as far as the advanced part:

    I need to add to the code some way to take the newly pasted rows from no. 3 above and change the value of Column 4 to "new".

    Here is my code:

    Please Login or Register  to view this content.
    The problem I am running into with the above code is it is not pasting the rows directly under the selected row - now matter how I have tried it, it wants to paste elsewehere as rRange isn't working in my code - How do i specify the rRange so it copy and inserts directly below the select cell/row?

    My code is very convoluted I am sure and I am a beginner .. My apologies.. any help would be swell!

  2. #2
    Registered User
    Join Date
    02-27-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro based on User input to Insert X amount of rows - Need advanced help

    Managed to find some help deep within the forums and modified my code to a different approach:

    Please Login or Register  to view this content.
    Now it is pasting over data already in the worksheet instead of inserting it.. and it seems to be only pasting 2 if the user specifies 3.. 4 if user specifies 5.. etc. etc..

    And I am still having trouble figuring out how to select the row newly pasted to change a column's value..

    Any help please?

  3. #3
    Registered User
    Join Date
    02-27-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro based on User input to Insert X amount of rows - Need advanced help

    I solved it with changing my code to this:


    Please Login or Register  to view this content.
    Thanks for any help, everyone

    Now I just have to figure out the other problem I am having.. i will try a new thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1