+ Reply to Thread
Results 1 to 7 of 7

What can i include in my macros code so that the code doesn't touch the header row?

  1. #1
    Registered User
    Join Date
    05-14-2015
    Location
    Chicago, Illinios
    MS-Off Ver
    2007
    Posts
    35

    What can i include in my macros code so that the code doesn't touch the header row?

    my code is

    Please Login or Register  to view this content.
    So this macros takes 2 list of digits, lines up the exact matches, and highlights differences or where there are blanks. But it sorts everything including A1 and B1, what would i include in there to leave A1 or B1 alone, or just all of row one?

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: What can i include in my macros code so that the code doesn't touch the header row?

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    in the sort
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    05-14-2015
    Location
    Chicago, Illinios
    MS-Off Ver
    2007
    Posts
    35

    Re: What can i include in my macros code so that the code doesn't touch the header row?

    Ok, when i ran the code it did this in the attachment. It pulled "sent by credit" in the header row and put it in B21
    Attached Images Attached Images

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: What can i include in my macros code so that the code doesn't touch the header row?

    Oops I guess I misunderstood the problem a little... I just focused on the sort function too quickly and I guess your concern has to do with the results of the rest of the code.
    Can you attach an actual workbook with some data (doesn't have to be real numbers, that replicates your error? I believe under some circumstances your code starts on row 1 because j=2 but then at the start of your i loop it sometimes makes j=j-1 so then you are back at row 1?

  5. #5
    Registered User
    Join Date
    05-14-2015
    Location
    Chicago, Illinios
    MS-Off Ver
    2007
    Posts
    35

    Re: What can i include in my macros code so that the code doesn't touch the header row?

    Here ya go. So basically what im doing is pulling statements. And someone else does the same. Sometimes they don't include certain deposits for whatever reason and my boss wants me to compare the statements that we have, versus what they have, which SHOULD be the same but sometimes they're not. So she wants to go back and do a side by side comparison to see what does match up. I got the original macros from somewhere but i forgot. I would also like to get rid of what gets put into column C and D after i run the macros and instead of say "match" or "no match" when it does match or when theres a discrepency.
    Attached Files Attached Files

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: What can i include in my macros code so that the code doesn't touch the header row?

    There's a workbook at https://app.box.com/shared/elrnbidnr7 with a macro that will generate this result:

    A
    B
    1
    Pulled by us Sent by Credit
    2
    $ 32.39
    $ 32.39
    3
    $ 101.70
    $ 101.70
    4
    $ 108.48
    $ 108.48
    5
    $ 159.33
    $ 159.33
    6
    $ 237.30
    $ 237.30
    7
    $ 343.52
    $ 343.52
    8
    $ 355.41
    $ 355.41
    9
    $ 1,663.17
    $ 1,663.17
    10
    $ 1,771.28
    $ 1,771.28
    11
    $ 1,962.62
    $ 1,962.62
    12
    $ 1,977.52
    $ 1,977.52
    13
    $ 2,500.00
    $ 2,500.00
    14
    $ 12,342.00
    15
    $ 13,423.00
    16
    $ 23,908.00
    17
    $ 56,000.00
    $ 56,000.00
    18
    $ 79,872.00
    19
    $ 329,342.00
    20
    $ 987,897.00
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    05-14-2015
    Location
    Chicago, Illinios
    MS-Off Ver
    2007
    Posts
    35

    Re: What can i include in my macros code so that the code doesn't touch the header row?

    Thanks that did it!

+ 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. Not Able To Include Code
    By PosseJohn in forum Excel General
    Replies: 5
    Last Post: 02-26-2016, 02:48 PM
  2. [SOLVED] Need help with VBA code. Tons of code seperated in two, second part of code doesn't work.
    By FragaGeddon in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-30-2015, 11:46 AM
  3. [SOLVED] Code need to be shorten up and also include inputbox
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2014, 07:31 AM
  4. [SOLVED] Include 2 sheets in code loop?
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-19-2013, 04:21 PM
  5. Modify code to include header formatting
    By msmick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2011, 07:41 PM
  6. Include a password in VB code.
    By GA in forum Excel General
    Replies: 6
    Last Post: 03-23-2006, 03:40 AM
  7. [SOLVED] Code to NOT include row 1 and 2
    By Annette in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2005, 11:06 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