Are you sure you want to use a macro to do this - you could do it without.
If you don't want sheet2 updated in real time - switch off auto clac and
press f9 every time you want it updated. The only down side is that your
sheet2 will have to hold formula to cater for the max size of data ever to
be entered in sheet1. The way I do this is to use an autoformat to check
for the customer ID in the cell above the one being checked and if it is the
same, simply change the colour of the text to white (or whatever your
backgorund colour is), I think you will find this easier on the eye than all
the dashes.
I'm not sure why you want a sheet2, but if the only reason is to remove all
the duplicate cust ids so the reader can easily see when the report is
moving on from one cust to another - then my suggestion will save you this
problem with the added benefit that the cust is still there (you just can't
see it). So if you want to do a sumif or other calc on the data you still
can.
Also have you looked at outlining - it sounds to me that this is what you
want to do and it is built in to Excel - best read the help on this.
"Gale7" wrote in message
...
hello, i am a new member in excelforum and a newbi in programming with
macros.
i have the following problem
i have five columns in excel sheet1 (A, B, C, D, E) - (cus_id,
cus_name, date, product, price,)
i want to put a command button where, when i press it, to appear in
sheet2 all the data (rows) leaving a (----------------) every time the
cus_id changes.
finaly i want to take (in sheet2) the sum of each customer, depending
on the customer id.
thnxs in advance
------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/