+ Reply to Thread
Results 1 to 5 of 5

copy and paste to a different workbook, change data, then repeat x 7

  1. #1
    Forum Contributor
    Join Date
    02-03-2020
    Location
    Wisconsin
    MS-Off Ver
    365
    Posts
    150

    copy and paste to a different workbook, change data, then repeat x 7

    Hello all. I'm hoping someone can help me write some code for the following commands. I took a stab at it and couldn't quite get it to work. This code is going to be for a command button. I want to copy a range of data into a 2nd workbook, on a specific sheet, into a specific range of cells - then repeat the process after changing a date.

    Step one is press the button
    Pop up box: "Is the date in B2 set for a Monday?" Yes or No - Yes = continue on / No = end process
    Unlock worksheet
    Select Range B173:E182
    Copy selection
    Open Target Workbook
    Goto Sheet 14
    Paste selection into cells A3:D12 (VALUES ONLY)
    Return to original workbook, sheet 1
    Select cell B2
    Change B2 to its current value + 1 (B2 is a date, and I want to repeat this process for all dates Mon-Fri so if B2 starts at 5/30, the next time around it will be 5/31, and the following time 6/1 etc)

    This process, starting with select range B173:E182, would then repeat 4 more times except the "paste selection into cells.." would change each time to E3:H12, I3:L12, M3:P12, Q3:T12

    Let me know if there are any questions.

    Thanks in advance!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: copy and paste to a different workbook, change data, then repeat x 7

    Did you have a code you needed help with, what happened when you used the macro recorder?

  3. #3
    Forum Contributor
    Join Date
    02-03-2020
    Location
    Wisconsin
    MS-Off Ver
    365
    Posts
    150

    Re: copy and paste to a different workbook, change data, then repeat x 7

    I kept getting an error, sorry I don't remember exactly what it was. It seemed to be getting stuck on the opening the target workbook if I remember correctly. Also, when pasting it wouldn't do values only.

    Im very new to this, I use code snippets from youtube. So I thought it would be easier if I posted exactly what I need so someone could help with doing it in a less convoluted way than I maybe doing it.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: copy and paste to a different workbook, change data, then repeat x 7

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,225

    Re: copy and paste to a different workbook, change data, then repeat x 7

    Try it
    Please Login or Register  to view this content.
    Artik

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy and paste data then move to next occupied data set and repeat...
    By Ourkid123uk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2019, 11:22 AM
  2. [SOLVED] Copy, Paste, Print data to a form & repeat process on next row.
    By Bikeman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-28-2016, 10:33 AM
  3. [SOLVED] VBA to copy/paste data (repeat for all rows)
    By terratushi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2016, 07:49 AM
  4. Open workbook copy&paste, save and close Repeat
    By JPSIMMON in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2016, 12:29 PM
  5. Copy column 1-18 then if further data to the right repeat and paste under first data
    By zx142985 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-14-2015, 04:43 AM
  6. Replies: 0
    Last Post: 03-06-2013, 02:31 PM
  7. [SOLVED] copy everything from column B to end of data, paste to summary, repeat for next worksheet
    By fabrecass in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-12-2013, 07:43 AM

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