Hello All! I am pretty new to VBA and UserForms. I have been trying to teach myself, and it has definitely been a bit time consuming (to say the least). I have been slowly pacing myself through this work project, and now I am hitting a roadblock with a few different things. I have tried to create my own code, but it is constantly giving me multiple different errors, so I have decided to see what y'all have to say!
The project (one of many that I am currently multitasking through) is to have a UserForm that searches a table from a specific value, returning all values from that specific value into the UserForm's other text boxes. Since there can be multiple rows with the same search value, the search function would need to loop through with a follow-up click that will populate the next rows values based off of the search value. After that is found, the person using the UserForm needs to be able to replace the returned values with different values and update the chosen line on the table, or press delete and remove that row's data completely. What would be nice is that once the row's values are deleted, the following rows' data moves up one row to prevent gaps in the table. I know this is a lot to ask, but I am going to be burning the midnight/weekend oil in order to accomplish this as well as other projects (Excel dashboards, Power BI dashboards, Power BI mobile dashboards, etc.). Any help to at least walk me through doing this is greatly appreciated! To help out, I have included specific details that should provide better help.
Table name is SunSch
Sheet name is Sheet1
UserForm has StoreNoTextBox as the focus to search and match values on the table
A Search command button is right by the StoreNoTextBox to allow for easier readability with the customer
UserForm will populate not only the rows store number, but location, address, pay, round trip miles, etc. (honestly, it can be Field1TextBox.Value, and I will be able to figure it out)
I do have check boxes as well, with two fields (Yes and No) for the same field (so HazmatCheck1 and HazmatCheck2 for example)
Once that information populates in the UserForm's text boxes, then the Update command button will update that specific row
There is also a Delete command button that, once the correct row is established, will delete that entire row's information
Hopefully, and I do say hopefully, there can be some way to move all rows data up a row after one is deleted, preventing a gap that could break up the table's uniformity
There are formulas throughout the table, so the Delete command has to only delete the values in the UserForm's text boxes, which should affect the formulas in a positive way.
Like I said, I am new to VBA but am trucking my way through. Any help is greatly appreciated, and I will be trying to work on all of this as well. I'd love to hear ideas and test out different methods, all the while learning from experts on this forum.
Thank you!
The project (one of many that I am currently multitasking through) is to have a UserForm that searches a table from a specific value, returning all values from that specific value into the UserForm's other text boxes. Since there can be multiple rows with the same search value, the search function would need to loop through with a follow-up click that will populate the next rows values based off of the search value. After that is found, the person using the UserForm needs to be able to replace the returned values with different values and update the chosen line on the table, or press delete and remove that row's data completely. What would be nice is that once the row's values are deleted, the following rows' data moves up one row to prevent gaps in the table. I know this is a lot to ask, but I am going to be burning the midnight/weekend oil in order to accomplish this as well as other projects (Excel dashboards, Power BI dashboards, Power BI mobile dashboards, etc.). Any help to at least walk me through doing this is greatly appreciated! To help out, I have included specific details that should provide better help.
Table name is SunSch
Sheet name is Sheet1
UserForm has StoreNoTextBox as the focus to search and match values on the table
A Search command button is right by the StoreNoTextBox to allow for easier readability with the customer
UserForm will populate not only the rows store number, but location, address, pay, round trip miles, etc. (honestly, it can be Field1TextBox.Value, and I will be able to figure it out)
I do have check boxes as well, with two fields (Yes and No) for the same field (so HazmatCheck1 and HazmatCheck2 for example)
Once that information populates in the UserForm's text boxes, then the Update command button will update that specific row
There is also a Delete command button that, once the correct row is established, will delete that entire row's information
Hopefully, and I do say hopefully, there can be some way to move all rows data up a row after one is deleted, preventing a gap that could break up the table's uniformity
There are formulas throughout the table, so the Delete command has to only delete the values in the UserForm's text boxes, which should affect the formulas in a positive way.
Like I said, I am new to VBA but am trucking my way through. Any help is greatly appreciated, and I will be trying to work on all of this as well. I'd love to hear ideas and test out different methods, all the while learning from experts on this forum.
Thank you!