+ Reply to Thread
Results 1 to 4 of 4

Writing a macro (copy&paste macro)

  1. #1
    Forum Contributor
    Join Date
    02-25-2008
    Posts
    101

    Writing a macro (copy&paste macro)

    Hiya,

    I'm very new (in fact a complete beginner) at writing macros, but I could really do with one for one of my workbooks. I've edited my workbook to make the macro as simple as possible, it should be just a copy, paste & delete macro. Bare with me a minute, I’ll try to explain clearly what I need...

    I have made and attached a very simplified version of apart of my workbook, which demonstrates what I want to do. Basically, the user will input some data. For purposes of simplicity, I’ve just made it simply cells D4:K4. Based on this inputted data, a hidden table will display certain other data in cells D9:K9. These cells are written to either display "" or "X" or a positive integer.

    What I need to happen, once all this data is complete (i.e. triggered by cell L9 saying "Yes"), the macro will run. The macro will first copy&paste the data from cells D9:K9 into the full table. It will need to go in the current round (stipulated by cell C9). Then the macro will need to delete the data in cells D4:K4.

    This will mean that when new data is inputted, it will go into the next round, and so on. Obviously the macro will need to stop working once 100 rounds are completed.

    Any help would be very, very much appreciated! Then hopefully I can rewrite the macro for my proper workbook. Apologies if I don’t get it straight away – I have always wanted to, but never have had a chance to learn a bit about macros.

    Thanks!
    P.S. I hope this makes sense, any questions, just fire away.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Writing a macro (copy&paste macro)

    Try this. It insures you scroll smoothly through the cells at the top of the page and automatically records the round when it is complete.

    After 100 rounds you will not be able to continue unless you clear the table.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Writing a macro (copy&paste macro)

    hi Skatmandu,

    My suggestion is to make the sample file as representative of your real file as possible. This saves everyone time & you can still work through the code thoroughly to help yourself learn.

    btw, I'm off to bed soon so someone else will probably help before I see the post again tomorrow.
    Edit: I've just seen JB's post after pressing the post button - you are already in capable hands

    Rob
    Last edited by broro183; 02-23-2010 at 06:24 PM.
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Writing a macro (copy&paste macro)

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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