+ Reply to Thread
Results 1 to 4 of 4

VBA code to combine data from two different sheet columns and paste new sheet and column?

  1. #1
    Registered User
    Join Date
    05-11-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    12

    VBA code to combine data from two different sheet columns and paste new sheet and column?

    Hi

    I have a simple Vba code to combine data from two columns in two different sheets into another sheet. The problem is that only the first statement of code executes. Meaning it only copy and pastes data from the "Security" sheet. It seems I am missing some code to combine the two statements. I will appreciate if someone can helps. my code is:

    Please Login or Register  to view this content.
    I will appreciate if someone can help.
    Last edited by Chris*; 01-14-2014 at 08:00 AM.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: VBA code to combine data from two different sheet columns and paste new sheet and colu

    Post a sample data set because the code works (as in it does not have an error) for me.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    05-11-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: VBA code to combine data from two different sheet columns and paste new sheet and colu

    Hi MikeTRON

    Please see attached file. Thanks for your help.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-11-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: VBA code to combine data from two different sheet columns and paste new sheet and colu

    Problem had to do with range of data that was to be copied. Range seems like it cannot be the whole column. When I specified the range as only the cells where the data appears the macro worked. Instead of Range("A:A") I had to specify it it as Range("A2:A500"). Then it worked.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 01-13-2014, 10:52 AM
  2. Replies: 0
    Last Post: 02-22-2013, 09:23 AM
  3. Combine data from 2 sheets with different columns
    By mulpuris in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2012, 09:45 AM
  4. How do you combine data from 5 sheets to 1 sheet?
    By geng in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2010, 08:33 PM
  5. [SOLVED] Want to combine columns in rows where data exists from multiple sheets into one
    By bugmenot in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2009, 08:27 PM

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