+ Reply to Thread
Results 1 to 7 of 7

Trying to copy Data from one worksheet to another

  1. #1
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Trying to copy Data from one worksheet to another

    Hi

    I'm tryn to copy values from A3:F# (untill the values stop). To another worksheet to Cell A3 and down.
    I'm tryn this but it gives me an error on the PasteSpecial part. I also tryed just Paste but it still doesn't work.

    Please Login or Register  to view this content.
    Last edited by stojko89; 11-24-2011 at 08:05 AM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Trying to copy Data from one worksheet to another

    Try:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Trying to copy Data from one worksheet to another

    Ok that worked. Thank you

    But my other problem is that it copys the range but if says in Column F I have a few cells empty it doesn't copy them:

    A3:E7 ----> Cells have Values
    F3:F5 ----> Cells have Values but Cells F6 and F7 don't have Values and so it doesn't copy Values from Row 6 and 7?
    And I also don't want all the sheets to have to become active for the codes to work it's a confusen when you run the makro and the excel starts poping from one sheet to another.
    Can I somehow avoid that?

    My code is this:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Trying to copy Data from one worksheet to another

    The UserForm that this VBA is connected to is on Sheet "Povprasevanja" and then it makes the "Narocila" Sheet active to do something and then it makes sheet "POV2011-001" active to do something else. So thats the confusing part

    Any idias about that?

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Trying to copy Data from one worksheet to another

    Maybe this:
    Please Login or Register  to view this content.
    .Cells(Rows.Count, 6) 6 - is the column number on which the last filled cell is determined. Try to use for example 1 (column A)

  6. #6
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Trying to copy Data from one worksheet to another

    nilem.

    Yeh that works great! Thank you very much

    But now I have a nother problem...in the same code. This is giving me a hard time:
    It keeps telling me its a misstype error or something like that
    Please Login or Register  to view this content.

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Smile no need for copy to copy

    Most of the time you don't need 'copy' to copy

    Please Login or Register  to view this content.
    Last edited by snb; 11-24-2011 at 05:21 AM.



+ 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