+ Reply to Thread
Results 1 to 10 of 10

Cooy from one sheet to another sheet until empty cell

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Cooy from one sheet to another sheet until empty cell

    Hello

    Again I ask your help. Only this way I can learn some VBA.
    I have a userform with an option button. When I click this button I want to do this:
    copy from Sheet1, from row 5,from column A to D, down until last cell from column A is empty; I want to paste this to Sheet2 (which is the active sheet), paste from A5;D5 down.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Cooy from one sheet to another sheet until empty cell

    How does the userform picture in the copy-paste? Do you want the copy paste to be done only when the option button is clicked?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Cooy from one sheet to another sheet until empty cell

    Maybe something like this?
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Cooy from one sheet to another sheet until empty cell

    This I know.
    But I want to select only cells wich are not empty
    Like if A12 is empty, copy from A5 to D4

  5. #5
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Cooy from one sheet to another sheet until empty cell

    I'm sorry, but I don't understand what you mean.

  6. #6
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Cooy from one sheet to another sheet until empty cell

    Just copy from Sheet1 A5:D5 to last row which is not empty to Sheet2 same A5:D5

  7. #7
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Cooy from one sheet to another sheet until empty cell

    I found something but still doesn't work:

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Cooy from one sheet to another sheet until empty cell

    Oh, now I think I know what you mean. There are some syntax mistakes in the code you posted, try this:
    Please Login or Register  to view this content.
    Is it working?

    edit: this code does the same but without selecting:
    Please Login or Register  to view this content.
    Last edited by RHCPgergo; 01-21-2013 at 07:24 AM. Reason: more efficent code added

  9. #9
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Cooy from one sheet to another sheet until empty cell

    Thank you.
    It' working perfect.
    I was thinking about something else, more complex, which doesn't needed here; something like:
    "... do until Last Row="<>"



    [SOLVED]

  10. #10
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Cooy from one sheet to another sheet until empty cell

    Glad to help.

+ 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