PDA

View Full Version : vb and command button help



sammy2007
06-28-2008, 05:29 AM
hi, i kinda dont know how to word this but i have a problem with my command button and vb coding. The thing is i have an order system i created, which consist of an 'order' sheet and 'process orders' sheet. When an order is placed, i click on the command button named process which the first row in the 'order' sheet is automatically copied into the 'process orders' sheet and then deleted from the 'order' sheet (its suppose to do that lol). The thing is i need to construct the code so that the orders are processed (copied) one at a time by the click of the command button than all at once. Here is the code:

Worksheets("New Orders").Range("A2:G2").Copy Sheets("Processed orders").Range("A2")
Worksheets("New Orders").Range("A2:G2").ClearContents


Worksheets("New Orders").Range("A3:G3").Copy Sheets("Processed orders").Range("A3")
Worksheets("New Orders").Range("A3:G3").ClearContents


So my question is how can i construct a code that will allow me to process orders one by one? please help and sorry for the essay lol

p.s. i have attached the file in case anyone wants to test it or is confused lol

Simon Lloyd
06-28-2008, 05:57 AM
Why do you want to process the orders from the top down one at a time?

sammy2007
06-28-2008, 06:14 AM
hi, its hust so that i personally feel it would look more professional lol

Simon Lloyd
06-28-2008, 07:38 AM
It would be beter if you just take all the orders that you have move them in one block and then sort by date created, anyway clearing contents will leave blank rows at the top of the list then you have to handle them. Is there a reason you dont want them moved as a block?