+ Reply to Thread
Results 1 to 2 of 2

Instantly change column values after copy/insert rows based on input - Selection parameter

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

    Instantly change column values after copy/insert rows based on input - Selection parameter

    I am using Excel 2010 on a Win7 machine.

    I have a macro that will prompt the user to select a cell.
    Then the macro will select that entire row.
    Then another prompt will ask the user how many rows they want copied.
    Then it will copy that row selected and insert how ever many rows the user prompted on No. 3 above.

    What I need:

    A way to instantly change the pasted values in one cell/coloumn of each newly pasted row..

    I can't seem to figure out how to select the rows I inserted (based on user input) to change the value automatically.. since the active cell will change often, I can't do it based on a range.. it has to be whatever rows were inserted by the user prompt..

    i.e.

    1.1.1.1 I0127955 29.4 m
    10.1.1.1 TAG-01 12 m

    User selects I0127955 and then the row is copied via macro. And then new rows are inserted via user input (in example below userinput = 2) and then the data becomes this with macro:

    1.1.1.1 I0127955 29.4 m
    1.1.1.1 I0127955 29.4 m
    1.1.1.1 I0127955 29.4 m
    10.1.1.1 TAG-01 12 m

    I need it to become this:
    1.1.1.1 I0127955 29.4 m
    new I0127955 29.4 m
    new I0127955 29.4 m
    10.1.1.1 TAG-01 12 m

    Here is my new and improved code!

    Please Login or Register  to view this content.
    I can't figure out how to define the selection without a range..
    Thanks for any help, everyone

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Instantly change column values after copy/insert rows based on input - Selection param

    Do you have a sample file that you can attach?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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