Results 1 to 3 of 3

Search Box

Threaded View

  1. #1
    Registered User
    Join Date
    08-08-2023
    Location
    India
    MS-Off Ver
    Ms Office 16
    Posts
    16

    Exclamation Search Box

    Dear All,

    I created a search box where in the data of a column gets filtered

    used the following code which worked initially but once the data was formatted to a table it stopped working, could someone guide which part of the code needs changing?


    the code is below-

    Dim SH As Worksheet
    Set SH = ThisWorkbook.Sheets("CUSTOMER_DATABASE")
    
    Dim LR As Integer
    LR = Application.WorksheetFunction.CountA(SH.Range("A:A"))
    
    If LR = 1 Then LR = 2
    
    
    Dim CUSTOMER_DISPLAY As Worksheet
    Set CUSTOMER_DISPLAY = ThisWorkbook.Sheets("CUSTOMER_DISPLAY")
    CUSTOMER_DISPLAY.Cells.Clear
    
    If Me.SEARCH_CD.Value <> "" Then
        SH.UsedRange.AutoFilter 2, "*" & Me.SEARCH_CD.Value & "*"
    End If
    SH.UsedRange.Copy CUSTOMER_DISPLAY.Range("A1")
    SH.AutoFilterMode = False
    Last edited by AliGW; 08-19-2023 at 11:47 AM. Reason: Code tags added - please review the forum rules.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Search partial text and return all rows of data that include search criteria
    By clintgebert in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2023, 08:31 PM
  2. [SOLVED] Search multiple worksheets for search term and paste results in a summary sheet
    By Andy15 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 04-03-2017, 01:49 PM
  3. [SOLVED] Code to search Excel and return results even if part of search text is present
    By Taoyuan00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2016, 09:20 AM
  4. Replies: 4
    Last Post: 12-02-2014, 05:17 PM
  5. Replies: 4
    Last Post: 11-08-2014, 04:57 AM
  6. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  7. Replies: 1
    Last Post: 10-18-2012, 05:52 AM

Tags for this Thread

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