can someone take a second to look at the attachement and help with a solution. I am trying to get the "search" button to work.
been awhile since i had a chance to look at this post. Is there anyone who can take a few moments to help out with this issue. the attached book1 is causing me some issue as i can not seem to get the search function to work.
Can I get a forum mod to close this post as unsolved? I need help with getting a search function to work, but postulating does not get me closer to an answer or solution. There for with the lack of guidance I could use I will take my question to another forum, with higher hopes and less frustration.
You have an unqualified range reference, which means it refers to the active sheet. So,
... or, better,Code:Set rSearch = Sheet3.Range("A1", Sheet3.Range("A65536").End(xlUp))
Code:With Sheet3 Set rSearch = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp)) End With
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
You left it 5 months before bumping!!!!!
You also haven't responded to your other post,which needed the Title amending. So read the Forum Rules& follow them or don't bother posting here
Last edited by royUK; 03-18-2010 at 03:40 AM.
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,
Not sure what you mean by 5 months as I started this post roughly a month ago. And as for the other post, it is closed by Daveexcel..thanks for the suggestion though of fixing it or not posting here any more.
SHG,
thanks that solved the issue up to that point, then it snagged a couple of lines down.
Code:Private Sub cmdFind_Click() Dim strFind, FirstAddress As String 'what to find Dim rSearch As Range 'range to search Set rSearch = Sheet3.Range("A1", Sheet3.Range("A65536").End(xlUp)) strFind = Me.txt1stName.Value 'what to look for Dim f As Integer With rSearch Set c = .Find(strFind, LookIn:=xlValues) If Not c Is Nothing Then 'found it c.Select '<--------- RunTime Error 1004, Select Meathod of Range class failed' With Me 'load entry to form .txtInitial.Value = c.Offset(0, 1).Value .txt2ndName.Value = c.Offset(0, 2).Value .txtAddress1.Value = c.Offset(0, 3).Value '.cmbAmend.Enabled = True 'allow amendment or '.cmbDelete.Enabled = True 'allow record deletion .cmdAdd.Enabled = False 'don't want to duplicate record f = 0 End With FirstAddress = c.Address Do f = f + 1 'count number of matching records Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address <> FirstAddress If f > 1 Then MsgBox "There are " & f & " instances of " & strFind Me.Height = frmMax End If Else: MsgBox strFind & " not listed" 'search failed End If End With End Sub
i reconfigured some stuff in my workbook, to try to get the search function to work a little better or at all (i was hoping) but this code continues to fail me. I have seen the code work, but I have had nothing but issue after issue with it.
Need help with adding a search function to my user form.
Attached is my workbook, current coding for the search function is not working properly. Any help is Welcome and Appreciated.
Instead of, which works only on the active sheet,Code:c.Select
GoTo takes an optional argument that you should look at in Help.Code:Application.GoTo c
EDIT: But before you do that, put Option Explicit at the top of every module.
Last edited by shg; 03-18-2010 at 07:43 PM.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
You suggested that you weren't receiving the help you required,I pointed out that you didn't respond immediately. A valid point, you then gave me negative feed back for this.
That is no way for persuading me to help, I also pointed out your lack of response to another post of yours, which actually had comments by at least two other mods.
Please feel free to sort your own problems, I won't be helping you further & read the Forum Rules because any future infringement will result in a ban!
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
royUK,
I am sorry that you feel that way. I have gone back through this thread and noticed that I have responded to every thing in a timely manner for a forum site, (within an hour or two) more over to point out again this thread was started roughly a month ago. Where you came up with 5 months is beyond me because the tag for the start of this thread is 2/17/2010.
The reason for the negative feedback is due to the wild assumption of 5 months and using this thread to point out a mistake that I made in another thread. As well as pointing out that if I could not fix my error on that thread that I should stop posting here. As I pointed out that thread was closed and does not allow me to make any changes to it. I also emailed Daveexcel and asked him why he didn’t move it instead of closing it.
If for some reason you feel that posturing and threatening me with being banned from this forum is warranted then please do not hesitate from fulfilling your desire. From where I sit, it seems like retaliation to a valid negative feedback.
For the most part this forum has been a blessing for people looking to broaden their Excel and VBA knowledge but if this is the attitude and response I am not sure why anyone would come here. If I remain un-banned I will return to seek help and offer any help I can with what knowledge I have. If not I will seek help in a different venue.
Set rSearch = Sheets("Customer_Information").Range("i4", Range("i65536").End(xlUp))
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks