LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Can anybody crack this VBA problem?

Hello

Here is the problem. I have 10 products of which the prices may change each
month. I keep monthly records going back 12 months. It looks like this...

Prod May-05 Apr-05 Mar-05 Feb-05 Jan-05 Dec-04
etc...
A $100 $100 $100 $90 $90 $100
B $90 $90 $90 $80 $80 $90
C $85 $85 $85 $70 $70 $80
D $60 $60 $60 $60 $60 $70
etc..

The above table would extend back to Apr 04 (i.e. 12 months) and go down to
product J. (i.e. 10 products).

In some instances the prices do not change month to month. e.g. May, Apr,
Mar are all the same. However in Feb the prices are different. In other words
there was a price change in MARCH-05 .

I have tried in vain to write some VBA code that will go thorugh the table
and leave only the months where price changes occurred.

So the code would start in the first column (May-05) and compare prices for
all products (A-H) with the prior month. If they are the same then the code
will remove(.clearcontents) the prior month and then move onto the next
month. If the prices are different then those prices will remain the in the
table and then those prices will be used to compare against prior months to
check for price changes.

In the end the table should contain only those columns where a price change
occured from the previous month.

In the example I give above the remaining columns would be Mar-05, Jan-05,
and Dec-04 as they show different pricing structures.

Looked at another way, I don't want any columns that have the same pricing
schedule. I just want a sequential representation of how prices have changed.

If anybody has any ideas then I would enjoy reading them. I have got halfway
throught the problem but then get stuck. It is simple to see if this months
column is the same as the prior month and delete if the same. But it gets
more complicated. Again, in the table above, you would start at Mar-05 and
clear the contents of Apr-05 as it is the same pricing structure. But then
you cannot move on to comparing Apr-05 with Mar-05. You need to still use
May-05 to compare with Mar-05.

I hope I have made it clear what I am trying to acheive. Please write back
if you need more information.

As always in this support community, any guidance is warmly received.

Best Regards


Alex


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password Crack Eric Fehlhaber Excel Discussion (Misc queries) 69 May 11th 23 03:42 AM
Crack This One! DINGO0Z Links and Linking in Excel 2 January 17th 08 11:20 PM
crack this!! theonlymac Excel Worksheet Functions 2 March 15th 06 09:25 AM
crack this!! theonlymac Excel Worksheet Functions 0 March 14th 06 04:29 PM
Crack a VBA password? trickdos[_8_] Excel Programming 4 July 26th 04 08:40 AM


All times are GMT +1. The time now is 09:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"