Hello everyone, i'm hoping that someone can help me as well as i hopefully can help others.
I have a small problem trying to figure out the correct vba code on an excel userform. What i'm trying to do?
Okay, i have an Excel spreadsheet full of data, a supplier database with columns ranging from A (trade) through to L (email address) (and inbetween containing things like contact name, address, company name etc), note 12 columns of data across and potentially infinite rows down as the database grows over time.
I have created frmSearch (userform) which contains TextBox1 and ListBox1 along with two cmdButtons - "Find All", and "Close".
The user fills part text into TextBox1 of the trade which they are looking for, and then clicks Find All. The Trade column (column A) is then searched for matching records. The results of the search are then populated in ListBox1.
I have a couple of problems I need help with please:
1. I need ListBox1 to show all 12 columns but it isn't doing this. I believe it can only show a maximum of 10 (0-9) when using the AddItem command. Is there alternative code to workaround this? (as i need to show all 12!).
2. After pressing Find All button, when the search results are returned in ListBox1 i want to be able to double-click on any of the results for that result to be transferred to a new userform say frmRecord into 12 relevant textboxes. On the bottom of frmRecord will be a button called Copy...
3. I then need a cmdButton to copy the text from the 12 textboxes so that i can use this information in other programs e.g. to paste into word.
4. How would i go about setting up a new userform to view the records, say with 12 textboxes (named after columns A-L) with 3 cmdButtons - one button for "Next Record", one for "Previous Record" and one for "Close" (to close form). The Next and Previous buttons would be used for navigating next and previous records in supplier database.
5. I also need to set up a separate userform to be able to Amend and Delete existing data in the database. I already have a userform setup for Adding new data.
Any help, suggestions, and hopefully solutions will be much appreciated.
Regards,
Matt
I have a small problem trying to figure out the correct vba code on an excel userform. What i'm trying to do?
Okay, i have an Excel spreadsheet full of data, a supplier database with columns ranging from A (trade) through to L (email address) (and inbetween containing things like contact name, address, company name etc), note 12 columns of data across and potentially infinite rows down as the database grows over time.
I have created frmSearch (userform) which contains TextBox1 and ListBox1 along with two cmdButtons - "Find All", and "Close".
The user fills part text into TextBox1 of the trade which they are looking for, and then clicks Find All. The Trade column (column A) is then searched for matching records. The results of the search are then populated in ListBox1.
I have a couple of problems I need help with please:
1. I need ListBox1 to show all 12 columns but it isn't doing this. I believe it can only show a maximum of 10 (0-9) when using the AddItem command. Is there alternative code to workaround this? (as i need to show all 12!).
2. After pressing Find All button, when the search results are returned in ListBox1 i want to be able to double-click on any of the results for that result to be transferred to a new userform say frmRecord into 12 relevant textboxes. On the bottom of frmRecord will be a button called Copy...
3. I then need a cmdButton to copy the text from the 12 textboxes so that i can use this information in other programs e.g. to paste into word.
4. How would i go about setting up a new userform to view the records, say with 12 textboxes (named after columns A-L) with 3 cmdButtons - one button for "Next Record", one for "Previous Record" and one for "Close" (to close form). The Next and Previous buttons would be used for navigating next and previous records in supplier database.
5. I also need to set up a separate userform to be able to Amend and Delete existing data in the database. I already have a userform setup for Adding new data.
Any help, suggestions, and hopefully solutions will be much appreciated.
Regards,
Matt