+ Reply to Thread
Results 1 to 26 of 26

Searching Information From Database.

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Searching Information From Database.

    Hello,

    I am seeking for VBA Macros where i can display an information from my other sheet. Something like using filter.

    Her are the details what i am looking for.

    i have a sheet named Database. When i start typing the work from any of the columns on the sheet it should display the results.

    More details will be provided if someone willing to help me. Cannot attached the file it is giving error 132KB.

  2. #2
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    Can someone help me please and why i cannot attached file as an sample.

  3. #3
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    Here is the link for my file CLICK HERE

    I need to search the typed value in all the columns and display the result below in sheet search from Data sheet.

  4. #4
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    I have found this script but it is searching from column B. Can anyone help me to setup the range of columns uptill 15 columns.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    hi there, re uploading file: it happens sometimes, try to zip it and post zipped

    PS. The link provided above is not correct and leads to nothing

  6. #6
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    Thanks for your response.

    Still problem remain the same here is the file LINK

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    The reason for a problem with uploading file:
    there is a limit on Excel files allowed for uploading - 1000 KB. Your file (previous post link) shows 1018.5 KB. Zip it and it should go ok as always

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    I've successfully downloaded the file.

    What is the maximum expected number of data rows for Sheet "Data"?

  9. #9
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    I have no idea i suggest to make it open because it is keep of adding the rows and columns presently i am using 25 columns and 13,000 rows but this is not fix.

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    please check attachment, try to search for some text (search is case-insensitive)
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    Thanks for reply and help.

    It is giving error. Say following:

    Run-time error '9':
    Subscript out of range

    Also it can be possible to remove case-insensitive

  12. #12
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    to remove case-insensitive: comment Option compare text line in Module 1

    re error: try to change this line in code "test":

    Please Login or Register  to view this content.
    to this one:

    Please Login or Register  to view this content.

  13. #13
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    You guys are genius. People like me are non professional we just think for a solution you guys just do it. Thanks for your very valuable help.

    One more think if i want to add or delete any field name which line i have to change. I have 7 different file which i have to work on every week. So, these fields are having different fields.

    Let say i don't want to see Contact person and his mobile. What should i do.

  14. #14
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    There is another issue if the data is not found it should give message Saying that data not found in your records

  15. #15
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    I giving error.

    Run-time error '9':
    Subscript out of range

    Also i have to close the workbook and open it again if i found the error. can you fix it please.

  16. #16
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    check the file which gives error this is original file CLICK HERE

    For password check your pm

  17. #17
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    re error: try the following amended code:

    Please Login or Register  to view this content.
    Last edited by watersev; 03-29-2012 at 03:28 PM.

  18. #18
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    The result is totally changed some record displayed correct and some are wrong.

    Wrong means places of fields. You have my file file try to check clinic you will find the issue which i am notifying to you.

  19. #19
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    the wrong places of fields appear due to the fact that CSV file created uses coma as field separator but some fields have coma inside so split by coma later produces more fields then should be

  20. #20
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    So i have to remove comas from my entire database this is impossible for me. Have to take out some solution for this.

    And what is this CSV file.

  21. #21
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    modified code to address coma inside field option:

    Module 1 code:

    Please Login or Register  to view this content.
    Thisworkbook level code:

    Please Login or Register  to view this content.

  22. #22
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    It id working fine but one more thing it the searching result not found it is giving error. It should give message saying data not found something like this.

  23. #23
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    corrected to avoid error if nothing found:

    Please Login or Register  to view this content.

  24. #24
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    Your 2nd script works fine but need small correction on empty search. If a user did not enter anything in the search box and press search button he should get a message saying you haven't enter anything in the search box.

    Can it be possible and this will be last correction.

  25. #25
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Searching Information From Database.

    code "test", please change this:

    Please Login or Register  to view this content.
    to this:

    Please Login or Register  to view this content.

  26. #26
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Searching Information From Database.

    It works thanks for your most valuable help for me.Reputation added and topic marked as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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