VBA UserForm Search command to populate text boxes in UserForm

JHud2022

New Member
Joined
Dec 16, 2021
Messages
10
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
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!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top