+ Reply to Thread
Results 1 to 2 of 2

Loop and copying data from different columns

  1. #1
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Loop and copying data from different columns

    Hello. I've written code to open files and then copy data from those files into a master file. The first time I just wanted to copy data from the first two columns, but now I would like to copy data from columns A:B and D:E and I'm not sure how to adjust my code. If someone could help I would appreciate it (explanations with code would be helpful too) The "else" statement below is used because I only want to add headers from the first worksheet. Thanks.

    Please Login or Register  to view this content.

  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: Loop and copying data from different columns

    Hi, amartino44,

    in your code you start copying over into a sheet starting at A1 but what will happen if you run this macro again? The first workbook copies to the range from A1 while the others are amended under the old data?

    Code is untested but may look like this:
    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

+ 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