+ Reply to Thread
Results 1 to 9 of 9

One click copy and paste

  1. #1
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    196

    One click copy and paste

    What I have is essentially a daily product order log. I have one master table at the top of the sheet with all of the details about each product, then below, we create a new order section for each day, and just copy and paste from the master table which product we need to put on order that day. It would be nice to be able to somehow click on the row of the product which I need to add to that days orders and it is copied and pasted below in that days order section, or instruct excel somehow to move this product down to that day's orders, without having to copy and paste and scroll up and down. Any ideas?


    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: One click copy and paste

    Try this and see if it does what you want, and then we can adapt it to make it more dynamic
    It depends on a named range which is called "master", currently set to column B in the cells adjacent to your table (B4:B8)
    To try it out in the attached workbook. Simply "left click" on the cell in column B next to the product you want.

    The code is in the sheet module. Right click on sheet TAB and View Code

    Please Login or Register  to view this content.
    During testing it is easy to disabled events without noticing until the macro stops working!
    - run this simple macro to EnableEvents again
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    196

    Re: One click copy and paste

    It did! What I noticed is after the 4th click, it then goes back up to the first row of that day's section, 30, and starts overwriting it.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: One click copy and paste

    Rows are now copied without overwriting - oops!

    You can take out
    Please Login or Register  to view this content.
    unless you want to go there after pasting the row


    Please Login or Register  to view this content.
    Making NamedRange "master" dynamic
    If you need to add rows to Master table, then use the Command Button
    If you select a row in that range, it triggers the change event macro - which you do not want
    By inserting rows within the "refersTo" range of any named range, the "RefersTo" range is automatically stretched - ie it becomes dynamic.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    196

    Re: One click copy and paste

    OMG you are saving me so much time! Question, how far over is it copying, is it just going to the end of the sheet, or does it stop at a certain column?

    Thanks!

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: One click copy and paste

    You are welcome

    It copies the whole row.

  7. #7
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    196

    Re: One click copy and paste

    Am I able to change it to copy only over to a certain column?

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: One click copy and paste

    Does this give you what you want?

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    196

    Re: One click copy and paste

    I think so! Question, what is the dif between a Microsoft Excel Object and a Module, in VBA? And then within the Microsoft Excel Object Folder, there is the specific sheet number and ThisWorkbook.

+ 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. Right click cut, copy paste menu...
    By Chazrab in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2015, 10:55 AM
  2. [SOLVED] VBA for Double Click Copy Paste
    By Kehoth01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2014, 02:34 PM
  3. Replies: 6
    Last Post: 07-27-2013, 09:02 AM
  4. [SOLVED] Double click to copy and paste value to first available row.
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2013, 05:37 PM
  5. [SOLVED] How to copy fr AU:AY & paste to O:S after double click at B in same row
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-14-2012, 03:34 PM
  6. COPY & PASTE on a click.
    By bittu2010 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-20-2012, 02:00 PM
  7. Copy and paste on click of a button
    By sillylady in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2009, 12:48 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