+ Reply to Thread
Results 1 to 9 of 9

Macro copying number to the wrong column. Please help me fix it?

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    70

    Exclamation Macro copying number to the wrong column. Please help me fix it?

    Hi,
    I was wondering if someone can help me.
    At the moment the most of the macros on this spreadsheet are working fine.
    However, when I filter the Revenue Report tab (yellow tab) by confirmed, and then go to the black tab (invoice audit) and press the copy from yellow tab button, it copies most of the data correctly.
    However there is something its doing incorrectly.
    One of the columns thats copying over, is copying it incorrectly. Here's what it should do...
    I need that whatever is in column J on the yellow tab (Revenue Report), to copy to column I on the black tab (invoice audit).
    Can you please help?
    Thank you in advance.
    Cele
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Macro copying number to the wrong column. Please help me fix it?

    See attached file, I hope that it's what you need.

    Regards,
    Antonio
    Attached Files Attached Files

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro copying number to the wrong column. Please help me fix it?

    You are making life more difficult by not having the same column labels in the two sheets and by not using the same layout. For instance in the renewal report there is no column for Qty which is in column H of the Invoice Audit sheet.

    If you change the name of column H on the Audit sheet to "Final Order Amount" and then delete Column I which currently is the Difference column from the yellow tab then your data will be correct.

    However as I say if you want to do stuff like this you'd be far better using an Advanced Data Filter in a macro.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Macro copying number to the wrong column. Please help me fix it?

    Like this it is correct

    Please Login or Register  to view this content.
    Kind regards
    Leo

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    70

    Re: Macro copying number to the wrong column. Please help me fix it?

    Almost Antonio. The thing is with the blank rows up at the top, if left blank, then it does this correctly. But when I attemped to remove the blank rows at the top, it moved everything over, one column. Is there anyway to fix that?

  6. #6
    Registered User
    Join Date
    07-20-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    70

    Re: Macro copying number to the wrong column. Please help me fix it?

    Leo, you got it!!! Thanks so much

  7. #7
    Registered User
    Join Date
    07-20-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    70

    Re: Macro copying number to the wrong column. Please help me fix it?

    Antonio, quick question for you...
    Is there anyway you can keep the column label Qty on the Invoice Audit tab? Meaning that it doesnt copy that data from the Renewal Report tab?

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro copying number to the wrong column. Please help me fix it?

    Hi,

    ...as I suggested earlier use a Data Filter Advanced (in a single line macro) and avoid unecessarily complicated vba code and loops which will be much slower with large ranges.

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro copying number to the wrong column. Please help me fix it?

    Hi,

    ...as I suggested earlier use a Data Filter Advanced (in a single line macro) and avoid unecessarily complicated vba code and loops which will be much slower with large ranges.

+ 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. Macro copying number to the wrong column. Can you help me fix it?
    By celeazul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2015, 07:28 PM
  2. Macro copying number to the wrong column. Can you help me fix it?
    By celeazul in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2015, 06:41 PM
  3. Macro copying number to the wrong column. Can you help me fix it?
    By celeazul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2015, 10:51 AM
  4. Wrong number of Arguments error on macro - help!
    By KarlaB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2015, 01:30 PM
  5. [SOLVED] Macro - Copying undefined number of rows in one column
    By Rogy in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-16-2015, 08:15 AM
  6. [SOLVED] Copying to wrong Column
    By bodwhat in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-24-2013, 01:28 PM
  7. Macro - wrong column reference
    By chemoul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2012, 11:22 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