+ Reply to Thread
Results 1 to 3 of 3

Reformating Report with Macro

  1. #1
    Registered User
    Join Date
    10-29-2010
    Location
    Detroit
    MS-Off Ver
    Excel 2007
    Posts
    2

    Reformating Report with Macro

    I am fairly new to programming macros and have a situation that is beyond what I normally create - any help would be greatly appreciated.

    I have a stock report from our company's ERP that needs to be qualified and reformatted based on certain criteria. I have attached a sample for clarification.

    Sheet1 shows what the report looks like after I run a preliminary scrubbing macro to remove blank rows and rows that are of no value. I've highlighted the information that I would like posted to a seperate sheet in the new format.

    Here is the part that I'm struggling with...

    The first couple records (marked on the file in red) have a List price value of 0 and therefore do no have a discounted price. I need the highlighted red cells of these records copied to a seperate sheet so we can go back and apply pricing to them later on - I've illustrated this on Sheet3.

    The next four records (marked on the file in green) have some List price value and only a single discounted price. I need the highlighted green cells of these records copied to a seperate sheet in the appropriate columns, which I've shown on Sheet2.

    Lastly, the next four records (marked on the file in blue) have some List price value and multiple discounted prices based on certain quantity breaks. I need the highlighted blue cells copied to the same sheet as mentioned in the previous paragraph (Sheet2), each cell in the appropriate columns.

    As you can see from the raw data in Sheet1, the record types tend to be mixed. Also, the record types that have quantity discounts don't always have the same quantity breaks or even the same number of breaks. I need to somehow have a macro recognize these different record types as it runs through the file and take the appropriate action.

    Can anyone help?
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reformating Report with Macro

    Try this out:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-29-2010
    Location
    Detroit
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Reformating Report with Macro

    JBeaucaire,

    I've ran your script against a couple different reports and so far everything looks great - I can't thank you enough for your help. I will post back if anything happens to go awry.

    I truely appreciate all the experts that devote their time to help within this forum, as it speaks volumes about the quality of the community here. Again, thank you for the help JBeaucaire and anyone who attempted a solution.

+ 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