Hi all,
I have a macro that converts a list of sale prices/dates from our database into a formatted price book. The way the database works, dates come out like this:
Item 1 -- 6/1/11 -- 7/31/11 -- $50
Item 1 -- 9/2/11 -- 12/1/11 -- $50
Item 2
etc.
The macro gets it to the point where every month with the sale prices (the 50s, in this case) is condensed and listed in a single cell like this:
Jun-Jul, Sep-Nov
The only problem I have right now is that our database won't run partial ranges for sale dates. So if Item 1 is on sale from June through July and September through November but I only want to show prices from July through September, I'll get prices outside the range I want. (This is only a problem because our contracts get renewed at different times, so some products might have accurate pricing through November before others. Having November on the sheet at all would be confusing if we only had fully correct pricing through September.)
So I get this: Jun-Jul, Sep-Nov
But I want this (if I'm looking for Jul-Sept pricing): Jul, Sep
(or it could end up being "Jul, Aug" or "Aug-Sep" or something, depending on the product)
I was thinking of putting in an input box of some sort for the dates, but I don't know how to code for excel to sort of "truncate" the date ranges into the intervals I want. I could probably also do this with a formula somehow if the desired range was entered into cells somewhere. I'm just not sure where I'd do it. The dates go through these stages:
8/1/11 -- 10/2/11 (2 cells) to "Aug-Sep" to "Aug-Sep, Oct, Nov-Dec,"
(however many sale ranges there are for one item)
Then the comma at the end gets taken out. To make it more confusing, sometimes the items are on special sales, which get marked like this:
Aug-Sep (DP), Oct, Nov-Dec (DP)
If anyone can lead me in the right direction as far as finding a way to get the dates to reorient themselves to user-inputted intervals, that would be great. Thanks so much,
Katherine
I have a macro that converts a list of sale prices/dates from our database into a formatted price book. The way the database works, dates come out like this:
Item 1 -- 6/1/11 -- 7/31/11 -- $50
Item 1 -- 9/2/11 -- 12/1/11 -- $50
Item 2
etc.
The macro gets it to the point where every month with the sale prices (the 50s, in this case) is condensed and listed in a single cell like this:
Jun-Jul, Sep-Nov
The only problem I have right now is that our database won't run partial ranges for sale dates. So if Item 1 is on sale from June through July and September through November but I only want to show prices from July through September, I'll get prices outside the range I want. (This is only a problem because our contracts get renewed at different times, so some products might have accurate pricing through November before others. Having November on the sheet at all would be confusing if we only had fully correct pricing through September.)
So I get this: Jun-Jul, Sep-Nov
But I want this (if I'm looking for Jul-Sept pricing): Jul, Sep
(or it could end up being "Jul, Aug" or "Aug-Sep" or something, depending on the product)
I was thinking of putting in an input box of some sort for the dates, but I don't know how to code for excel to sort of "truncate" the date ranges into the intervals I want. I could probably also do this with a formula somehow if the desired range was entered into cells somewhere. I'm just not sure where I'd do it. The dates go through these stages:
8/1/11 -- 10/2/11 (2 cells) to "Aug-Sep" to "Aug-Sep, Oct, Nov-Dec,"
(however many sale ranges there are for one item)
Then the comma at the end gets taken out. To make it more confusing, sometimes the items are on special sales, which get marked like this:
Aug-Sep (DP), Oct, Nov-Dec (DP)
If anyone can lead me in the right direction as far as finding a way to get the dates to reorient themselves to user-inputted intervals, that would be great. Thanks so much,
Katherine