+ Reply to Thread
Results 1 to 5 of 5

Copy and paste from one worksheet to another worksheet macro problem

  1. #1
    Registered User
    Join Date
    07-14-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Copy and paste from one worksheet to another worksheet macro problem

    Hi!

    New to VBA, Excel 2010, Calculation option set to manual (Sorry if I missed any info needed)

    I have made a macro that with a click of a button gets some values of a formula from one worksheet and pastes them in another worksheet and my problem is that when I press the button again it just overwrites values from the first row instead of pasting them on a new row.

    Please Login or Register  to view this content.
    Thanks in advance for any help

    Regards, Zebastian Luthin
    Last edited by Kerbazee; 07-14-2013 at 09:21 PM. Reason: As per Forum Rule #3, please use code tags…Thanks.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy and paste from one worksheet to another worksheet macro problem

    Hi, Kerbazee,

    get the first empty row in Column A on Sheet Draw and pass the values. If you insert a formula into F2 on Draw it will keep the value as long as the workbook is not calculated but adapt to the new value on every calculation (and on saving).

    Maybe try this code:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    07-14-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Copy and paste from one worksheet to another worksheet macro problem

    Works like a charm! Thanks man!

    Another question, is there a way to run that a 1000 times without clicking the button 1000 times just want to see if my random numbers are unique.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy and paste from one worksheet to another worksheet macro problem

    Hi, Kerbazee,

    IŽd go away from a certain number for running the loop and go for an open loop which would end when you finally reached what you are after (this might take more than 1000 times). So instead of using

    Please Login or Register  to view this content.
    I would use WorksheetFunction.Countif to check the range and the number and only copy over when a new value has been found.

    Please Login or Register  to view this content.
    This is just a descrition - if you need help on getting the code for it please feel free to come back and ask.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    07-14-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Copy and paste from one worksheet to another worksheet macro problem

    Hey HaHoBe!

    Thanks for the help man I figured it out with your help!

    Cheers
    //Kerbazee

+ 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. Macro to copy data from one worksheet and paste to another worksheet
    By robertmiller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2013, 09:56 AM
  2. [SOLVED] Copy data from a worksheet and paste to worksheet with a similar worksheet name
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2012, 04:02 AM
  3. Copy data from a worksheet and paste to worksheet with a similar worksheet name
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2012, 02:49 AM
  4. Excel VBA problem with copy and paste from different worksheet
    By banidnigo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2012, 10:22 PM
  5. [SOLVED] Copy/Paste Active Cell to new worksheet problem
    By ipmaham in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-13-2012, 10: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