• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search, update & insert in a excel table

inddon

Member
Hello There,

I have a given excel table "Tbl_Customers" with the below column Names:
1. Customer ID (Unique)
2. Customer Name
3. Amount

And 3 Cells (where User can enter), 1 message cell and 2 buttons:
1. Customer ID
2. Customer Name
3. Amount

4. Operation Message: To display a message
5. FInd (Button)
6. Submit (Button)

I would like to know the actual VBA code to do the operations of a searh, update and insert a row.
Search a entered Customer ID from the cell (always a unique value) in the table (If INDEX/MATCH could be a faster approach, then I would prefer it):
1. Search: (via Find Button) If found then do the below:
A. table column value of Customer Number and Amount --> into the cells Customer Name and Amount
B. display message in the cell Operation Message = Customer found
If NOT found then do the below:
A. display message in the cell Operation Message = Customer NOT found
2. Update (via Submit Button): Perform above search and if found then do the below:
A. Update the entered Customer Name and Amount from the cells into the Table
B. display message in the cell Operation Message = Customer details updated.
3. Insert (via Submit Button): Perform above search and if NOT found then do the below:
A. Insert a row in the Table from the entered cells of Customer ID, Customer Name and Amount.
B. display message in the cell Operation Message = Customer details inserted.

I have attached a sample workbook for your reference.

Thank you and look forward to hearing from you.

Regards,
Don
 

Attachments

Top