+ Reply to Thread
Results 1 to 11 of 11

Movie Database Search.

Hybrid View

hecgroups Movie Database Search. 02-01-2012, 11:28 AM
royUK Re: Movie Database Search. 02-01-2012, 11:35 AM
hecgroups Re: Movie Database Search. 02-01-2012, 11:46 AM
hecgroups Re: Movie Database Search. 02-02-2012, 12:04 PM
hecgroups Re: Movie Database Search. 02-05-2012, 12:04 PM
royUK Re: Movie Database Search. 02-05-2012, 01:14 PM
hecgroups Re: Movie Database Search. 02-05-2012, 11:40 PM
hecgroups Re: Movie Database Search. 02-06-2012, 12:13 PM
royUK Re: Movie Database Search. 02-06-2012, 02:02 PM
hecgroups Re: Movie Database Search. 02-06-2012, 11:20 PM
hecgroups Re: Movie Database Search. 03-09-2012, 04:43 AM
  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
    906

    Movie Database Search.

    Hello again,

    Kindly, see the attached file and edit the code so that if i type a part of text belongs to Column A it will grab the data from the other sheets and display below in search sheet.

    Can anyone help me in this issue.

    Sheet is attached for your easy reference.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Movie Database Search.

    Your data should be in one sheet, separated into columns.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  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
    906

    Re: Movie Database Search.

    thanks for responding to my request.

    yes my data is in one sheet. i.e. Movie list1 and when i search it will display all the results match to my search with black highlighted fields in search 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
    906

    Re: Movie Database Search.

    up till now no response from anyone.

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

    Re: Movie Database Search.

    no one wants to help me to setup this script.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Movie Database Search.

    Your existing code doesn't even point to the correct cells. Try this

    Option Explicit
    
    Private Sub Search_Click()
        Dim rCl As Range
        Dim NR As Long
        Dim sFind As String
        Dim Movie As String
    
        If IsEmpty(Range("A2")) Then
            MsgBox "Please enter your search"
            Exit Sub
        End If
        'Erase old results
        Sheets("Search").Range("A5:K" & Rows.Count).ClearContents
        'List new results from all sheets
        sFind = Range("A2").Value
        With Worksheets("Movie List1")
            For Each rCl In .UsedRange.Columns(1).Offset(1, 0).Cells
                Movie = rCl.Value
                If InStr(Movie, sFind) > 0 Then
                    With Sheets("Search")
                        NR = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
                        .Cells(NR, 1).Value = rCl.Value
                        .Cells(NR, 2).Value = rCl.Offset(1, 0)
                        .Cells(NR, 3).Value = rCl.Offset(2, 0)
                        'etc
                    End With
                End If
            Next rCl
        End With
    End Sub

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

    Re: Movie Database Search.

    Thanks boss i will check and let you know the status. Thank you very much for responding to my request.

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

    Re: Movie Database Search.

    Thanks royUK,

    Kindly check the updated file but having some errors. the movie name (Description) is correct but the rest of the information is not correct.

    Check the attachment.
    Attached Files Attached Files

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Movie Database Search.

    I think this fixes it. I changed the Row reference instead of the Column in the database part

    Option Explicit
    Private Sub Search_Click()
    
        Dim rCl As Range
        Dim NR As Long
        Dim sFind As String
        Dim Movie As String
    
        If IsEmpty(Range("A2")) Then
            MsgBox "You haven't enter anything, please enter your search."
            Exit Sub
        End If
        'Erase old results
        Sheets("Search").Range("A5:K" & Rows.Count).ClearContents
        'List new results from all sheets
        sFind = Range("A2").Value
        With Worksheets("Movie List1")
            For Each rCl In .UsedRange.Columns(1).Offset(1, 0).Cells
                Movie = rCl.Value
                If InStr(Movie, sFind) > 0 Then
                    With Sheets("Search")
                        NR = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
                        .Cells(NR, 1).Value = rCl.Value
                        .Cells(NR, 2).Value = rCl.Offset(, 1)    'for size
                        .Cells(NR, 3).Value = rCl.Offset(, 2)    'for album name
                        .Cells(NR, 4).Value = rCl.Offset(, 3)    'for years
                        .Cells(NR, 5).Value = rCl.Offset(, 5)    'for catogary
                        .Cells(NR, 6).Value = rCl.Offset(, 6)    'for Season
                        .Cells(NR, 7).Value = rCl.Offset(, 7)    'for Type
                        .Cells(NR, 8).Value = rCl.Offset(, 8)    'for format
                        .Cells(NR, 9).Value = rCl.Offset(, 9)    ' for length
                        .Cells(NR, 10).Value = rCl.Offset(, 4)    ' for length
                    End With
                End If
            Next rCl
        End With
    End Sub

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

    Re: Movie Database Search.

    Hai royUK,

    it is working fine. I will get back to you if i have any problems otherwise i this topic will be marked as solved and reputation will be added to you of course. Thanks for your efforts and valuable help.

    God Bless You.

  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
    906

    Re: Movie Database Search.

    Hai royUK,

    I have an issue with this script.

    First issue is when i type my word in search sheet column A2 its searching from sheet Movie List1 column A where as i want to search from column C.

    Second issue is test case and part of string. It means there should be no case sensitive and part of string is typed in search it should display the result.

    Example: if I type string "and the Half" in search column it providing me the result.If i type And The Half it is not displaying anything.

    Can you help me to resolve these issues please.

    Waiting for your response.

+ 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