+ Reply to Thread
Results 1 to 14 of 14

Data Transfer From One Sheet To Another

  1. #1
    Registered User
    Join Date
    02-26-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    11

    Cool Data Transfer From One Sheet To Another

    First post so I hope I get this right.

    I am using the following code to transfer data from one sheet to another depending on a set criteria which works fine. The information is transferred into sheet2 through the month and cleared at the end on the month. My problem is I need to set the start row on sheet2 to row 16 and then to transfer to the next free row as it does now.

    Please Login or Register  to view this content.
    I hope that the above makes sense. Any help would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Data Transfer From One Sheet To Another

    I did not understand what you want, attach a sample file with comments
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    02-26-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Data Transfer From One Sheet To Another

    Thanks for replying. I have attached my sheet. I am transferring information from sheet 1 to sheet 2 via a button. The macro copies all rows from sheet 1 that have a "Y" in column R and transfers them to sheet 2. I have put this together from other threads and this works fine. My problem is that at present it pastes the information into Row 2 on Sheet 2 but my table starts at Row 16.

    Cheers
    Attached Files Attached Files

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

    Re: Data Transfer From One Sheet To Another

    Do you want the data from Sheet1 to be cleared after the copy paste?

    Also after copying the data, if you update more data in Sheet1, will you be clearing the existing data in Sheet1 and then updating information or will you update it at the next available row in Sheet1?
    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]

  5. #5
    Registered User
    Join Date
    02-26-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Data Transfer From One Sheet To Another

    No the data in sheet 1 is a running list and will be updated in the next available row each time. The data in sheet 2 will be cleared to create a new list each time.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Data Transfer From One Sheet To Another

    EDIT: Code removed. Corrected code found below.
    Last edited by JBeaucaire; 03-26-2013 at 08:23 PM. Reason: removed code to clean the order of reading this thread.

  7. #7
    Registered User
    Join Date
    02-26-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Data Transfer From One Sheet To Another

    AB33, Thanks for the reply but I cannot get this to run. I get an object defined error?

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Data Transfer From One Sheet To Another

    In which line of the code you got the error?

  9. #9
    Registered User
    Join Date
    02-26-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Data Transfer From One Sheet To Another

    ws.Rows(x).Copy ws1.Cells(NR, 1)

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Data Transfer From One Sheet To Another

    I have run the code on the attached. I did not get an error, but column R of sheet1 is empty, so the code will find nothing.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Data Transfer From One Sheet To Another

    My bad,
    Sorry,
    Change this line
    N=16
    TO
    NR = 16

  12. #12
    Registered User
    Join Date
    02-26-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Data Transfer From One Sheet To Another

    The file I attached has 2 entries in column R on sheet 1, rows 16 & 17 both have a "Y".

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Data Transfer From One Sheet To Another

    Have corrected the code.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-26-2013 at 08:24 PM.

  14. #14
    Registered User
    Join Date
    02-26-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Data Transfer From One Sheet To Another

    AB33 you are a star. Works perfectly. Thank you. Thank you to everyone else as well.

+ 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