Basically I need to be able to have a few tables for sales of specific categories e.g. pc and laptop. I also need to have a main table that displays all sales.
For input i’m using input boxes and a dropdown to select which category (pc or laptop), this input is then just put in to one large table along with the sale information. I’m just wondering what the best method for having this data put in to a separate worksheet just for that category is? I’m at a bit of a loose end where to start. I thought about possibly using an IF statement in the VB where if the input is e.g. PC then also insert into the worksheet PC but this seems like quite an inefficient way of doing this.
Your ideas are greatly appreciated.
If you are unsure where to place your VB code, it’s probably best to add the code not behind one of the sheets, but in a separate module. On the other hand, you will need an entry point your code which is called at a specific event. That might be a worksheet event (for example, the change event) or simply a button or menu the user has to activate when he wants the main table to be updated. Call your module code from there.
If you could provide us with a specific example, we could probably give you a better answer.
Using the worksheet change event: add code like this to each of your input sheets:
UpdateMainSheetshould be a public Sub in a separate module which copies the input data from the given sheet to your main sheet (should also delete data in the main sheet which has been deleted on the given sheet).