Help with VBA search function within Userform

SiEn

New Member
Joined
Mar 28, 2023
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hello everyone, I have after believing my Excel knowledge to be flawless i have hit the reality check when i undertook this project.
I have started an advanced course and within some of that knowledge gained, I started an adventurous project for an order book.
I have uploaded the workbook onto dropbox so hopefully someone can help...

A little about the project and what i am trying to achieve.
I want an order book that will eventually contain locked cells that can be updated via userforms, this is my 100th attempt! the ultimate aim is to stop accidental deletion of data. (This form is shared and updated by 7 users)
I have 7 different work types (all with their own sheets) within these sheets is the ability to add a new record, amend a record and add additional info etc.
Within the add new button it seems to be all working correctly including allowing a unique "ref Id" following the format i want for each sheet.

I have started the second part of the project and have fallen at the first hurdle! (This is the Modify Record button) although will also stretch to the other 3 buttons as i want to be able to search all of the generated Ref ID numbers to bring up the data within the userform and then allow that data to be added or modified, i cannot achieve this. This can be just the generated ID for that sheet, ultimately i want to have a sheet that will contain all of the data but thats a story for another day... there is alot more to do following this and i might be back for some additional help but i am attempting to do this to gain the knowledge for the future!

Can anyone help, have i explained this well enough? Thanks in advance
Simon

 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Just wanted to give an update I seem to have solved this on my own...
alot of errors getting to it but the below seems to have worked, hope it helps someone else!

VBA Code:
Private Sub cmbSearchModify_Click()
Dim RefID As String
RefID = Trim(txtRefIDModify.Text)
lastROw = Cells(Rows.Count, "C").End(xlUp).Row
For i = 2 To lastROw
If Cells(i, "C").Value = RefID Then
cbEstimator.Text = Cells(i, 5).Value
cbType.Text = Cells(i, 6).Value
txtJobTitleModify = Cells(i, 7).Value
cbJobStatus = Cells(i, 8).Value
End If
Next
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,847
Messages
6,181,337
Members
453,032
Latest member
Pauh

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