Consulting

Results 1 to 4 of 4

Thread: vb and command button help

  1. #1

    vb and command button help

    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

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Why do you want to process the orders from the top down one at a time?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    hi, its hust so that i personally feel it would look more professional lol

  4. #4
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    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?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •