+ Reply to Thread
Results 1 to 4 of 4

Missing Something From Code

  1. #1
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Boston, MA
    MS-Off Ver
    Office 2010
    Posts
    172

    Missing Something From Code

    Hi,

    Here's my code:

    Please Login or Register  to view this content.
    The idea is to take the columns from table called "AllCancelData" and move them to the Table "AllData". AllData contains the same columns, except it is in a different order.
    What you see in the code to set the Arrays are Table Names, not named ranges.

    The problem is that right now this macro is moving all columns in vMoveData and pasting them into every column in vDataArea. So by the end, the table "AllData" contains "AllCancelData[Listing]" in every column. I've attached a file in case that explanation was terrible.

    I know there is a way to exit a for loop based on a condition, but I tried saying if something wasn't blank then to exit loop, but then it exits after one column is copied. Please help!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Missing Something From Code

    You should only have one loop.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Missing Something From Code

    Maybe this:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Boston, MA
    MS-Off Ver
    Office 2010
    Posts
    172

    Re: Missing Something From Code

    You da man, Norie.

    Can anyone provide a good learning source for VBA code? I'm self taught so far, but i am looking for a good site to use as a reference when I don't understand things like LBound and UBound (I googled them, but hoping for something that's not just using google)

+ 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. code to add row sor the missing dates
    By hussein f in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2015, 01:04 PM
  2. Missing some code
    By coys1717 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2014, 12:59 PM
  3. I'm missing something in this code.
    By umax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2006, 02:59 AM
  4. Missing something in my code...
    By Turquoise_dax in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2006, 01:00 PM
  5. VB code gone missing
    By Ian in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2005, 08:00 AM

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