pls help!! copy -paste to another sheet. getting the sum

  • Thread starter Thread starter Gale7
  • Start date Start date
G

Gale7

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
 
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.
 
Actually, you can get most of what you want by copying the sheet and then
select your data and do Data=>Subtotals and use cust_id as the grouping
column and price to be summed.

This doesn't require any programming. Try it out and see if it is
sufficient.

You could collapse the data (using the outline buttons on the left side) so
you see only the sums, then select the range and do Edit=>Goto => Special
Cells and select visible. Then perhaps you can use a border format setting
to achieve the visual separation you want.
 
yes they told me that it can be done without macros but i have to do it
in macro :(
i really need some help on this (with code)

thanks for answering
achilleas
 
mmm - if you know how to do it manually - but "they" tell you it has to be a
macro - then record it using the macro recorder -then it will be in VBA !!

Who are "they" ?
 
Back
Top