Not sure if I am linking this correctly but here it goes...http://www.excelforum.com/excel-prog...ification.html
This is a previous post link that is now solved but I have a new question based on the code in the post. I would like to know how to add a search and update ability to the user form I have created. I am newb with user forms so I apologize in advance for my lack of knowledge.
And yes I know the way it is set up now it is depositing data in two different locations; this is for a specific purpose.
Take a look at the DatabaseForm example here
http://excel-it.com/vba_examples.htm
The earlier example already has code added using .Find, so you can also see how that works.It just needs applying to a Find button as the suggested example does
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
Roy, thanks for the link. trying to implement the ideas into my userform. will repost the completed product when if I get it to work.
I have no idea what i did wrong, but when i tried to use the cmbFindAll piece of code i was suprised to see it wipe my entire workbook out. I dont just mean wiped out i mean gone. I can hit Alt+F11 and see the pages within the workbook but I can not access them. When i try and run a macro I get a global fail error message. I removed the code from my user form and saved but found no joy in this correcting the issue.
Have you got a copy with the code in? I doubt if the code caused this, that's one of my top downloads, must be several thousand.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
I had to start from a backup copy of my workbook. lucky for me there is only one minor change between the two copies so I didnt lose a lot of work. I will try to re-insert the code and see what happens.
Add the code exactly as you did before,then attach it. I'll take a look
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
ok so I have the workbook working 100%, but not the piece of code. this is how i modified it but i must be missing something as i get an error when i search.
the sheet the parts are stored on is "Part_Center" the sheet the user form is on is "Bid_ToC" the first cell any part is listed on in the "Part_Center" sheet is A4 (A4:F4 makes up the current full line information for the first part)Code:Sub cmbFindAll_Click() Dim strFind As String 'what to find Dim rFilter As Range 'range to search Set rFilter = Part_Center.Range("a3", Range("f65536").End(xlUp)) '<------ Error occurs here' Set rng = Part_Center.Range("a4", Range("a65536").End(xlUp)) strFind = Me.txtModel.Value With Bid_ToC If Not .AutoFilterMode Then .Range("A4").AutoFilter rFilter.AutoFilter Field:=1, Criteria1:=strFind Set rng = rng.Cells.SpecialCells(xlCellTypeVisible) Me.ListBox1.Clear For Each c In rng With Me.ListBox1 .AddItem c.Value .List(.ListCount - 1, 1) = c.Offset(0, 1).Value .List(.ListCount - 1, 2) = c.Offset(0, 2).Value .List(.ListCount - 1, 7) = c.Offset(0, 7).Value End With Next c End With End Sub
any idea on how to make this work?
To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.
If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.
Doing this will ensure you get the result you need!
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
attached a workbook that i have been using to test with.
royUK..I have attached the requested example..hopefully you can help with this issue.![]()
Still looking for a little help on this please.
There's no Part Centre worksheet. What have you serched for & what ios the error message?
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
The code I posted is from the actual workbook I am working on, the attachment I posted has the code set for the attached workbook and is my test book. The two are not the same in that respect but the code is relatively the same. But I am getting the same stop point in the posted example and the actual workbook.
Run-time error ‘1004’-
Method ‘Range’ of object’_Worksheet’ failed
I have tried changing ‘Sheet3’ to “Customer_Information” in the attached example posted but the error is the same, so I am not sure what mistake I am making.Code:Set rSearch = Sheet3.Range("a1", Range("a65536").End(xlUp))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks