+ Reply to Thread
Results 1 to 13 of 13

Error with VBA copy/paste

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Error with VBA copy/paste

    Hi,

    I'm trying to copy certain columns of data from one source sheet to a template with the following code;

    Please Login or Register  to view this content.
    It won't work though, there is an error within the code somewhere.

    I have attached an example.

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

    Re: Error with VBA copy/paste

    Hi, kenadams378,

    maybe alter the column for deciding the range to copy from empty Column B to C?
    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
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Error with VBA copy/paste

    Please Login or Register  to view this content.

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

    Re: Error with VBA copy/paste

    Slightly better

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Error with VBA copy/paste

    Many thanks, i forgot to add, there will already be data on the template so need to find the next blank row before pasting the OBA workings data into the template.

    Example attached

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

    Re: Error with VBA copy/paste

    Ken,
    Have you tried the attached? It pastes in to next empty row in any column +1.

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

    Re: Error with VBA copy/paste

    The next empty cell in template sheet is row 19, so my code was right?
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Error with VBA copy/paste

    Ah, many thanks...

    Much appreciated

  9. #9
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Error with VBA copy/paste

    Hi, following discussion last week, this is how the output appears following the code used

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

    Re: Error with VBA copy/paste

    Ken,
    What is the issue(Problem)?
    The code still works on the attached.

  11. #11
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Error with VBA copy/paste

    In my attachment the code runs and populates the cells from row 6, the first 2 rows of this data aren't needed. 1 row are the headers which i already have and the 2nd row of data is just #N/A errors

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

    Re: Error with VBA copy/paste

    But the code is copying from rows 2 to last row of sheet OBA Workings in to next empty row in sheet Load Template.
    Could you please explain what needs to be changed?

  13. #13
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Error with VBA copy/paste

    You are correct, i've found the issue..

    Many thanks for your help

    Appreciate your time!!

+ 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