+ Reply to Thread
Results 1 to 4 of 4

VBA to detect change in order number, then add a value to each 1st line of that order

  1. #1
    Forum Contributor
    Join Date
    12-18-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 365
    Posts
    108

    VBA to detect change in order number, then add a value to each 1st line of that order

    Hi, I'm about to finalize my monthly billing report but am left with 1 more challenge...

    On my report, column A conatins an order number.
    I am am allowed to charge a fee for services provided, but this is 1x fee of (let's say 100 USD) per order. This fee is included on column B.

    The problem is that some order numbers are showing up more than once on that report,
    and I am currently manually skimming through the report to add the '100' USD fee to each new order.

    The file is already sorted by order number, so I am hoping someone knows the code to 'detect' a change in order number, and then for each 1st line of the order number that is detected to change a 100 USD fee.
    Any additional lines should be marked with a value of 0 USD.

    Thanks

  2. #2
    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,486

    Re: VBA to detect change in order number, then add a value to each 1st line of that order

    Maybe,as an example:

    HTML Code: 

    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


  3. #3
    Forum Contributor
    Join Date
    12-18-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 365
    Posts
    108

    Re: VBA to detect change in order number, then add a value to each 1st line of that order

    Exactly what I was looking for TMS!
    Thanks for you assistance

    regards, marijke

  4. #4
    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,486

    Re: VBA to detect change in order number, then add a value to each 1st line of that order

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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