<<<  Return to the BodyMod.org Community
  Active TopicsActive Topics  CalendarCalendar  Search The ForumSearch  
General Talk About Anything
 BodyMod.org Forum : General Chit-Chat : General Talk About Anything
Message Icon Topic: Are you a pro with Excel and VBA? I need help!! Post Reply Post New Topic
Author Message
FeetyPajamas
Heavy Modder
Heavy Modder
Avatar

Total Mods: 14

Joined: June/29/2006
Posts: 1224
Quote FeetyPajamas Replybullet Topic: Are you a pro with Excel and VBA? I need help!!
    Posted: April/09/2012 at 7:13pm
As our final in my Excel "support" class, we're building an address book. My part in the whole clusterfuck is to write the code for the "Search" button. I really suck at this crap. Can anyone help? I'd go into more details, but before typing my ass off, I thought I'd see if anyone was around who had the know-how. :)


"Just lil ol' me. one lonely nipple"
IP IP Logged
TR_966
Heavy Modder
Heavy Modder


Total Mods: 15

Joined: August/17/2011
Posts: 321
Quote TR_966 Replybullet Posted: April/10/2012 at 1:59pm

Been a while (couple of years since my last "Excel Master" class certification, had to go back to my books and do a bit of searching myself. Hope this helps. :)

The following code should be placed in the click procedure of your 'Find' Command Button (in this case it is called Find Button). When the button is pressed, the text that is present in a text box on your worksheet (in this case TextBox1) will be found. If the text does not exist on the worksheet, then an error message is displayed.

Private Sub FindButton_Click()
           Dim strFindWhat As String
           strFindWhat = TextBox1.Text
           On Error GoTo ErrorMessage

    Cells.Find(What:=strFindWhat, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False).Select
    Exit Sub
       ErrorMessage:
                  MsgBox ("The data you are searching for does not exist")
End Sub


Edited by TR_966 - April/10/2012 at 2:03pm
IP IP Logged
FeetyPajamas
Heavy Modder
Heavy Modder
Avatar

Total Mods: 14

Joined: June/29/2006
Posts: 1224
Quote FeetyPajamas Replybullet Posted: April/10/2012 at 5:05pm
We're making an address book of sorts. One sheet has places to click on radio buttons to specify what to search on a different sheet for. Last name, first name, etc.  For instance, if someone chose to search by first name, and they just entered the letters ro in the text box, I need it to search all of the column that the first names are in, and find the letters ro. Someone else is working on the part of the code that selects the names that have those letters in them, and puts them in a field that the user will be able to choose which 'ro' they want. Like, it'll return results like Rosco, Robert, Bronson, etc.  Make sense?
 
Can I pick your brain some more? My email is cbgarrison@gmail.com


"Just lil ol' me. one lonely nipple"
IP IP Logged
TR_966
Heavy Modder
Heavy Modder


Total Mods: 15

Joined: August/17/2011
Posts: 321
Quote TR_966 Replybullet Posted: April/11/2012 at 9:03pm
I don't know how much help I 'll be, but I will try. I used Excel daily in my old job and not at all in my new one (last three years). I have done something similar to what you are talking about, I am just trying to remember. My e-mail is TR_966@hotmail.com Mention Bmod in the subject so I will open. What year Excel are you using? Mine was 2003, but not that much has changed.
IP IP Logged
TR_966
Heavy Modder
Heavy Modder


Total Mods: 15

Joined: August/17/2011
Posts: 321
Quote TR_966 Replybullet Posted: April/11/2012 at 9:13pm
function that search for value http://www.teacherclick.com/excel2003/a_4_5_1.htm
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.656 seconds.