Results 1 to 4 of 4

Copy/Paste Range Several Times while changing a few cells in 1-2 rows

Threaded View

  1. #1
    Registered User
    Join Date
    10-03-2015
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    1

    Copy/Paste Range Several Times while changing a few cells in 1-2 rows

    Hi,

    I am new on this forum, but I can already see it is a very useful resource for anyone who needs to learn how to do new stuff. So, hello and thanks for reading my thread.

    I need to copy a range of data multiple times and make some changes to a few rows(2-3) in each set of copied data. Each row will be identified by the first cell. Example:

    JobTitle Engineer 2 50-60k 2.5%


    where Engineer is the job, 2 is the years at current job 50-60k is the salary range and 2.5% is the year-end bonus.

    What I need to do is: copy the data set, search for rows that start with 'JobTitle' , modify 'Engineer' to 'Engineer 2 50-60' to denote job seniority and salary range. For this row, I will have dropdowns for job seniority 1-10+, salary range with different ranges and bonus percentages with different percentages. I wonder if it is possible to change "Engineer" to "Engineer SeniorityValue SalaryRange" and assign different values to 'SeniorityValue' and 'SalaryRange' as I change the values in the dropdowns.

    The alternative would be having a prompt that asks me how many times I need the data copied and then asking for values for 'SeniorityValue' , 'SalaryRange' and 'Bonus' for each one of the copied data ranges from a predefined list of seniority years, salary ranges or bonus percentages. The rest of the copied data stays the same, it's just these rows that need to change. This would be the preferred solution, if it is not too complex?

    I have the code to copy the data a predefined number of times, from this forum:

    Sub cpyMultV()
    Dim sh As Worksheet, lr As Long
    Set sh = Sheets(1)
    nbr = Application.InputBox("Enter the number of times to copy.", "TIMES TO COPY", Type:=1)
    counter = 0
    Do While counter < nbr
    lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
    sh.Range("A2:DR68").Copy sh.Range("A" & lr + 2)
    counter = counter + 1
    Loop
    End Sub
    What I need is how to modify just 4 cells in 1-2 rows in each data set(those rows that start with 'JobTitle').

    I hope I was clear enough, my knowledge of Excel is not very good.

    Thanks.
    Last edited by smiket; 10-04-2015 at 11:56 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy paste rows based on criteria 3 times into a separate worksheet
    By Ganeshgopinath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2015, 09:03 AM
  2. copy a range of cells N times and paste in separate sheet and also change a specific colum
    By maramkarthik in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2013, 04:27 AM
  3. [SOLVED] Copy and paste rows 3 times
    By Hyperdude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2013, 02:59 AM
  4. [SOLVED] Macro to copy/paste dynamic range x times into same sheet
    By BigAl_Qld in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2013, 03:48 AM
  5. [SOLVED] Copy and paste a range x many times
    By acsta14 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-20-2012, 07:15 AM
  6. Copy and paste rows multiple times
    By Novis in forum Excel General
    Replies: 5
    Last Post: 03-21-2009, 11:43 AM

Tags for this Thread

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