+ Reply to Thread
Results 1 to 5 of 5

Help debugging Macro

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

    Help debugging Macro

    Hi,

    I don't know what is wrong with this code, but it won't seem to work correctly:

    Please Login or Register  to view this content.
    The idea of the Macro is to take data from the three tables listed in the array and move them into a table within a sheet called "AllData". The problem is that it's only moving the first line from "ArmenisTable" and the full "BorekTable", and seems to be completely disregarding "BassaniTable". When I'm debugging and I hover over "Range(vMoveAllData).Copy a little pop-up box appears that says "vMoveAllData = "ArmenisTable".

    I have no idea what is wrong. My tables all include 4 rows, so I don't understand why they are not all copying over. Please help!

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Help debugging Macro

    This seems to be working for me: Make sure that all of your tables are correctly labelled and try it
    Please Login or Register  to view this content.

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Help debugging Macro

    Where is the rest of the code? There is no Sub or End Sub line so you have code that you are not sharing.

    I need to see the rest to start to help you.

    Ideally you should just post the whole sheet, sensitive data removed.
    Last edited by skywriter; 04-13-2015 at 11:07 AM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

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

    Re: Help debugging Macro

    @ARowbot:

    Your code worked for me. Thank you! However, I'm in a learning process here, so can you explain what was wrong with mine, and how yours, which only seemed to change how the paste area was selected, fixed the code?

    Thanks again!

  5. #5
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Help debugging Macro

    Please Login or Register  to view this content.
    Selects the first cell and then moves down to the bottom of the data and offsets by 1. If there are any gaps in Column A then it will go to that cell.
    By the sounds of it what happened to yours was that it pasted the first table, then on the row below it pasted the next table and then the next table on top of that one.

    The code I used selects the very bottom row in column A and then comes up to the very bottom of the data and offsets it by one row meaning it will always paste at the very end so it doesn't overlap anything previously.

    Hope that explains it well enough.

+ 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. [SOLVED] Help debugging macro
    By kellynicolebarrett in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-16-2014, 09:17 AM
  2. [SOLVED] Debugging a macro
    By jharaldson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2013, 01:52 PM
  3. [SOLVED] Macro debugging
    By VelvetRevolver84 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-01-2013, 06:14 PM
  4. Help please in debugging this macro
    By sungen99 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-23-2006, 11:45 AM
  5. Debugging macro
    By annep in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2006, 06:18 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