+ Reply to Thread
Results 1 to 17 of 17

Simple Search and Edit Function on Excel VBA

  1. #1
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Simple Search and Edit Function on Excel VBA

    Hi,

    I am new to this site and I have been searching for a simple tutorial on how to do a search and edit userform on excel. I have found several examples however I am unable to understand them completely as I am new to VBA and would like to ask for help on my simple project.

    I have attached the file and I am lost as to where to start. I hope you guys can help me and guide me through on how to start my Search and edit functions.

    Lets say I am searching for username1 and VIP level is 17 and case type would be AC Cases. It will show the results at the bottom.

    Eddy
    Last edited by eddieboyph; 02-25-2016 at 09:01 PM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,540

    Re: Simple Search and Edit Function on Excel VBA

    The attachment does not mean anything to me. 4 Sheets with 1 Row of date in 2 sheets only. No explanation whatsoever.

    Maybe Google for "Find and Replace" if I understand you right.

  3. #3
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Hi jolivanes,

    The file is tracker for cases. We have account closure cases, Open cases and technical cases. I was able to add cases on each sheet. I am now trying to search for existing cases depending on the username, case type or case num.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Simple Search and Edit Function on Excel VBA

    When performing a search is there 1 result to be found or is it possible that multiple results are found ?
    The reason I ask is in first case just add 7 textboxes to display result. Otherwise you have to add 7 textboxes and 1 listbox where you can select 1 of found results and then display in textboxes.
    Last edited by bakerman2; 02-25-2016 at 02:16 AM.

  5. #5
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Hi bakerman2 ,

    It is possible to have multiple results when doing a search. I have updated the search interface to what I was aiming for.
    Last edited by eddieboyph; 02-25-2016 at 04:37 AM.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Simple Search and Edit Function on Excel VBA

    First draft.
    First select Case type then select either username or case number and click Search.
    If there's only 1 result foud all data is automatically transferred to textboxes and comboboxes.
    Otherwise click desired row in Listbox.
    Make changes (never casenumber) and click Update.
    Try it out and let me know where it goes wrong or you want it changed.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Quote Originally Posted by bakerman2 View Post
    First draft.
    First select Case type then select either username or case number and click Search.
    If there's only 1 result foud all data is automatically transferred to textboxes and comboboxes.
    Otherwise click desired row in Listbox.
    Make changes (never casenumber) and click Update.
    Try it out and let me know where it goes wrong or you want it changed.
    Hi bakerman!

    You are a lifesaver! This is exactly what I am trying to achieve.

    I tried using the update function but it gives me an error saying "Run time error '13 Type mismatch".

  8. #8
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Quote Originally Posted by bakerman2 View Post
    First draft.
    First select Case type then select either username or case number and click Search.
    If there's only 1 result foud all data is automatically transferred to textboxes and comboboxes.
    Otherwise click desired row in Listbox.
    Make changes (never casenumber) and click Update.
    Try it out and let me know where it goes wrong or you want it changed.
    Hi bakerman!

    You are a lifesaver! This is exactly what I am trying to achieve. Thank you for helping me

    I tried using the update function but it gives me an error saying "Run time error '13 Type mismatch".

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Simple Search and Edit Function on Excel VBA

    Explain which steps you took because everything works fine here.

  10. #10
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Hi bakerman2,

    I downloaded the file again and now it is working!

    Thank you for your help!

  11. #11
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Hi bakerman2,

    I apologize for bugging you . The Add Tech Cases is not working and is giving me an error saying "Object Required".

    Here's what I did:
    -add Tech cases
    -Fill in the details
    -add case - pop up shows saying object Require Runtime error 424

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Simple Search and Edit Function on Excel VBA

    Will get back to you later on today.(work is calling)

  13. #13
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Hi bakerman2,

    I was able to fix it. the name of the combo boxes are different so I had to double check.

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Simple Search and Edit Function on Excel VBA

    This should fixed it all.
    Also Bottom Comboboxes in SearchForm are now loaded with correct lists.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    Hi bakerman2,

    This is great. I have one more request. Is it possible to edit the case number as well?

    Eddy.

  16. #16
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Simple Search and Edit Function on Excel VBA

    Not as it is setup now.
    That is because casenumber is now used to locate the correct rownumber of selected data.
    You should have to add an extra column on each sheet in which you create a unique identifier which in turn you could use to reference the correct row of data you want to update.

  17. #17
    Registered User
    Join Date
    02-24-2016
    Location
    Makati, Philippines
    MS-Off Ver
    2013
    Posts
    14

    Re: Simple Search and Edit Function on Excel VBA

    I am now trying to understand the codes.

    Thank you for your help bakerman2.

    Eddy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. simple macro to add new record, edit/ search and print record
    By xmoore in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2015, 08:10 PM
  2. [SOLVED] Simple Search for Value Function
    By amonty78 in forum Excel General
    Replies: 4
    Last Post: 06-10-2014, 08:21 AM
  3. 'Simple' textbox search function help on validation
    By michaelcouch87 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2014, 04:56 AM
  4. implement database search and edit function
    By dharmang1910 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2013, 12:38 PM
  5. Search & Edit Macro / Function
    By michaelweaver4 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-09-2012, 06:23 PM
  6. Userform search and edit function help
    By adjustermn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2010, 03:35 PM
  7. Create a Macro from this simple search function
    By McMasters in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-24-2009, 05:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1