Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
Can anybody help me with my problem... I really need to create a search
button whith would look like : Text Box where i can put the number, or date or some text and next to the Text Button i would hv a Command button with name: Search on it. So basically i will put the number or date or whatever and than i will click on "search button" and i would find what i am looking for is dat possible ? I am really stupid with all those codes so can anybody put step by step 4 me? Thank you so much |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
Hi Michael,
I'm not trying to be rude, but is there something that you want to achieve that pressing 'Ctrl + F' doesn't already do? Cheers, Ivan. On Apr 1, 11:00*pm, Michael wrote: Can anybody help me with my problem... I really need to create a search button whith would look like : Text Box where i can put the number, or date or some text and next to the Text Button i would hv a Command button with name: Search on it. So basically i will put the number or date or whatever and than i will click on "search button" and i would find what i am looking for is dat possible ? I am really stupid with all those codes so can anybody put step by step 4 me? Thank you so much |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
so first of all u r not beeing rude its curiosity isnt it
second of all its database for people who dont know excel that well as i think you do third of all my Boss gave me that order forth of all r u able to help me ? or should i wait for someone who knows how to do it cuz i really need a help. Meanwhile save ur personal comments for yourself :-) I had asked for help not asked what i want to achieve- Are you having a bad day at work ? ;-) Cheers, Michael |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
On Apr 1, 9:34*am, Michael wrote:
so first of all u r not beeing rude its curiosity isnt it second of all its database for people who dont know excel that well as i think you do third of all my Boss gave me that order forth of all r u able to help me ? or should i wait for someone who knows how to do it cuz i really need a help. Meanwhile save ur personal comments for yourself :-) I had asked for help not asked what i want to achieve- Are you having a bad day at work ? ;-) Cheers, Michael "I had asked for help not asked what i want to achieve" Here are my words of advice: don't be rude; use proper English; and be willing to explain your end results.to someone who's willing to help you. Until then, use Ctrl+F like was suggested. It has a textbox and a button and all that. C |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
Hi Michael,
No, work is fine... thanks for asking :). As I said, I relly wasn't trying to make a personal comment. I know it sounded like I was but I was simply very puzzled and I really couldn't think of another way to ask. I sincerely do apologise. As for your question, the following code should give a starting point: Private Sub CommandButton1_Click() Dim SearchStr As String SearchStr = TextBox1.Text Cells.Find(What:=SearchStr, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate End Sub This assumes you have added a form with a text box called TextBox1 and a button called CommandButton1. If you want to use the returned range somewhere, get rid of the ".Activate" at the end of the search bit, and use a variable to catch the range: Set FoundRng = Cells.Find(... Cheers, Ivan. On Apr 2, 12:34*am, Michael wrote: so first of all u r not beeing rude its curiosity isnt it second of all its database for people who dont know excel that well as i think you do third of all my Boss gave me that order forth of all r u able to help me ? or should i wait for someone who knows how to do it cuz i really need a help. Meanwhile save ur personal comments for yourself :-) I had asked for help not asked what i want to achieve- Are you having a bad day at work ? ;-) Cheers, Michael |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
Michael,
It may be worth mentioning to your boss that re-inventing the wheel isn't normally a good idea unless there really is something specifically different that you are trying to achieve. I doubt any code that we could write in VBA would ever be as strong and efficient as that which is built into the program itself. For example the code that I posted has no error checking whatsoever. To crash it, all you would have to do is search for something that doesn't exist and you will see what I mean. This can of course be trapped and fixed, but I'd like to see anyone crash the built in search box. Personally I think that teaching people 'Ctrl+F' would be easier than running to a user's desk every time they do something you never anticipated and break your code. Regards, Ivan. On Apr 2, 1:19*am, Ivyleaf wrote: Hi Michael, No, work is fine... thanks for asking :). As I said, I relly wasn't trying to make a personal comment. I know it sounded like I was but I was simply very puzzled and I really couldn't think of another way to ask. I sincerely do apologise. As for your question, the following code should give a starting point: Private Sub CommandButton1_Click() * * Dim SearchStr As String * * SearchStr = TextBox1.Text * * Cells.Find(What:=SearchStr, After:=ActiveCell, LookIn:=xlFormulas, _ * * * * LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ * * * * MatchCase:=False, SearchFormat:=False).Activate End Sub This assumes you have added a form with a text box called TextBox1 and a button called CommandButton1. If you want to use the returned range somewhere, get rid of the ".Activate" at the end of the search bit, and use a variable to catch the range: Set FoundRng = Cells.Find(... Cheers, Ivan. On Apr 2, 12:34*am, Michael wrote: so first of all u r not beeing rude its curiosity isnt it second of all its database for people who dont know excel that well as i think you do third of all my Boss gave me that order forth of all r u able to help me ? or should i wait for someone who knows how to do it cuz i really need a help. Meanwhile save ur personal comments for yourself :-) I had asked for help not asked what i want to achieve- Are you having a bad day at work ? ;-) Cheers, Michael- Hide quoted text - - Show quoted text - |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
Ivyleaf- I'm going to try that tomorow because today i have finished my
work... i hate excel even more :-) Anyway i am really appraciated for your help i really am. Before I had gone throw everything and than i decided to ask somebody for help. So once again thank you very much and i will write to you tommorow letting you know if everything works. Hopfully it will ;-) Have a lovely evening ! Michael Btw i didnt mean to be rude i do appologize too |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
hello? How r you today ? How's everybody ? well unfortunatelly it doesn't
work. I created the blank office worksheet added my database, CommandButton, Text box i made sure that i copied the code and paste i correct place. The formula below doesnt work as it is red: Cells.Find(What:=SearchStr, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate I dont know whats wrong ;( Im loosing my mind... My PC runs Office 2000 maybe that is why ? I assume that it doesnt matter because the code should stay the same in upgrated version as well?! Im getting fed up of all those codes €žIvyleaf€ť pisze: Hi Michael, No, work is fine... thanks for asking :). As I said, I relly wasn't trying to make a personal comment. I know it sounded like I was but I was simply very puzzled and I really couldn't think of another way to ask. I sincerely do apologise. As for your question, the following code should give a starting point: Private Sub CommandButton1_Click() Dim SearchStr As String SearchStr = TextBox1.Text Cells.Find(What:=SearchStr, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate End Sub This assumes you have added a form with a text box called TextBox1 and a button called CommandButton1. If you want to use the returned range somewhere, get rid of the ".Activate" at the end of the search bit, and use a variable to catch the range: Set FoundRng = Cells.Find(... Cheers, Ivan. On Apr 2, 12:34 am, Michael wrote: so first of all u r not beeing rude its curiosity isnt it second of all its database for people who dont know excel that well as i think you do third of all my Boss gave me that order forth of all r u able to help me ? or should i wait for someone who knows how to do it cuz i really need a help. Meanwhile save ur personal comments for yourself :-) I had asked for help not asked what i want to achieve- Are you having a bad day at work ? ;-) Cheers, Michael |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
Hi Michael,
If I understand you correctly and the code is showing up in red colour, it sounds like you are just having problems with the wrapping. Try the following with the lines shortened: Cells.Find(What:=SearchStr, After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlPart, _ SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate Cheers, On Apr 2, 6:42 pm, Michael wrote: hello? How r you today ? How's everybody ? well unfortunatelly it doesn't work. I created the blank office worksheet added my database, CommandButton, Text box i made sure that i copied the code and paste i correct place. The formula below doesnt work as it is red: Cells.Find(What:=SearchStr, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate I dont know whats wrong ;( Im loosing my mind... My PC runs Office 2000 maybe that is why ? I assume that it doesnt matter because the code should stay the same in upgrated version as well?! Im getting fed up of all those codes "Ivyleaf" pisze: Hi Michael, No, work is fine... thanks for asking :). As I said, I relly wasn't trying to make a personal comment. I know it sounded like I was but I was simply very puzzled and I really couldn't think of another way to ask. I sincerely do apologise. As for your question, the following code should give a starting point: Private Sub CommandButton1_Click() Dim SearchStr As String SearchStr = TextBox1.Text Cells.Find(What:=SearchStr, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate End Sub This assumes you have added a form with a text box called TextBox1 and a button called CommandButton1. If you want to use the returned range somewhere, get rid of the ".Activate" at the end of the search bit, and use a variable to catch the range: Set FoundRng = Cells.Find(... Cheers, Ivan. On Apr 2, 12:34 am, Michael wrote: so first of all u r not beeing rude its curiosity isnt it second of all its database for people who dont know excel that well as i think you do third of all my Boss gave me that order forth of all r u able to help me ? or should i wait for someone who knows how to do it cuz i really need a help. Meanwhile save ur personal comments for yourself :-) I had asked for help not asked what i want to achieve- Are you having a bad day at work ? ;-) Cheers, Michael- Hide quoted text - - Show quoted text - |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
search buttons please help
It Does work ! OMG i am so appriciated! I am so much. Thank you once again
for quick respond and nice chat ;-) So yeah it does work everything is fine- i was so mad at Excel but its fine now. Thank you so much !!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Option Buttons/Radio Buttons | New Users to Excel | |||
Form buttons vs. ActiveX Buttons | Excel Discussion (Misc queries) | |||
have toggle buttons but everytime print preview buttons move | Excel Discussion (Misc queries) | |||
Replacing macro buttons with a new set of buttons | Excel Programming | |||
Create a search Field within a worksheet to search command buttons | Excel Programming |