working on it ...

Filters

Explore Public Snippets

Sort by

Found 6 snippets matching: "excel search"

    public by fabio.nosenzo  2557  0  5  0

    Excel simple search cycle

    How to implement vlookup function in MS Excel VBA
    Public Function searchstring(ByVal sString As String, ByVal iColumn As Integer) As String
    
    ' iColumn sets vlookup colum to be returned
    ' set cycle lenght
    Dim iTable As Integer
    iTable = 100
    ' result set to blank by default
    Dim sResult As String
    sResult = ""
    
    
    Sheets("Sheet").Select
    
    For n = 2 To 1 + iTable
    
        If sString = Cells(n, 1) Then
            SResult = Cells(n, iColumn)
        	  n = 100	
    	 End If
        
    Next n
    
    Sheets("Original Sheet").Select
    searchstring = sResult
    End Function

    external by hdprintwall  507  0  2  0

    Search 2015 - Calendars Printables, Excel, With Holidays, Happy Birthday Images, Wishes, Messages, Quotes

    Search 2015 - Calendars Printables, Excel, With Holidays, Happy Birthday Images, Wishes, Messages, Quotes: Print Images .md
    <a href="http://www.imgoz.com/">Images</a>
    <a href="http://www.imgoz.com/2015/11/kim-kardashian-2015-full-hd.html">Kim Kardashian</a>
    <a href="http://www.imgoz.com/2015/11/david-beckham-images-biography-history.html">David Beckham</a>
    <a href="http://www.imgoz.com/2015/11/cover-letter-images-cover-letter.html">Cover Letter</a>
    <a href="http://www.imgoz.com/2015/11/happy-birthday-2015-images-gallery.html">Happy Birthday</a>
    <a href="http://www.imgoz.com/2015/11/top-happy-birthday-wishes-quotes-2015.html">Happy Birthday Wishes</a>
    <a href="http://www.imgoz.com/2015/11/january-2016-calendar-printable.html">January 2016 Calendar</a>
    <a href="http://www.imgoz.com/2015/11/world-best-footballer-cristiano-ronaldo.html">Cristiano Ronaldo</a>
    <a href="http://www.imgoz.com/2015/11/2016-calendar-images-printable-free.html">2016 Calendar</a>
    <a href="http://www.imgoz.com/2015/11/2015-calendar-printable-templates-docx.html">2015 Calendar</a>
    <a href="http://www.imgoz.com/2015/11/quotes-about-love-10-love-quotes-images.html">Quotes About Love</a>
    <a href="http://www.imgoz.com/2015/11/what-is-bmw-bmw-information-images.html">BMW</a>
    
    

    external by kimhogeling  328  0  2  0

    Search Google Predictions with help of a given array and print them with tabs for excel

    Search Google Predictions with help of a given array and print them with tabs for excel: GooglePredictions.js
    var printPredictions = (function(brands){
    
        function ajax(options) {
            var xhr;
    
            function _ensureReadiness() {
                if (xhr.readyState < 4) {
                    return;
                }
                if (xhr.readyState === 4) {
                    options.callback(xhr.responseText);
                }
            }
    
            xhr = new XMLHttpRequest();
            xhr.open('GET', options.url, !options.sync);
            xhr.onreadystatechange = _ensureReadiness;
            xhr.send('');
        }
    
        function printPredictions(predictions) {
            var pretty = '';
            predictions.sort();
            predictions.forEach(function(pgroup){
                pgroup.forEach(function(p){
                    pretty += p + '\t';
                });
                pretty += '\n';
            });
            console.log(pretty);
        }
    
        function extractPredictions(brand) {
            ajax({
                url: 'https://www.google.de/complete/search?sclient=psy-ab&hl=de&biw=935&bih=985&q=' + brand + '&oq=&gs_l=&pbx=1&bav=on.2,or.&bvm=bv.113370389,d.ZWU&fp=8dea42e2d2e72e2a&dpr=1&pf=p&gs_rn=64&gs_ri=psy-ab&tok=pEtPxsU4Q3Hw69ebj4kr_A&pq=nike&cp=5&gs_id=e&xhr=t&tch=1&ech=2&psi=psK4Vv6nOMH6O9SdicAB.1454949031318.3',
                callback: function(data) {
                    try {
                        data = data.replace('/*""*/', '');
                        data = JSON.parse(data);
                        data = JSON.parse(data.d);
                        data = data[1];
                        data = data.map(function(pre, i) {
                            var found = data[i][0];
                            found = found.replace('<b>', '');
                            found = found.replace('</b>', '');
                            return found;
                        });
                        predictions.push(data);
                    } catch (e) {
                        console.log('Es gab ein Problem bei ' + brand, e);
                    }
                    if (brands.length === predictions.length) {
                        printPredictions(predictions);
                    }
                }
            });
        }
    
        var predictions = [],
            inputField = document.querySelector('.gsfi');
    
        brands.forEach(extractPredictions);
    
        return function() { printPredictions(predictions) };
    
    }(['adidas', 'puma', 'nike', 'apple', 'samsung']));
    
    // In case an error occured, print manually with: printPredictions();
    
    
    

    external by titipata  253  0  2  0

    Yasin's read excel and produce search

    Yasin's read excel and produce search: search_through_excel.md
    You need to install Python and `pandas` library before running this script.
    
    Assuming we have `.xlsx` sheet sit right at where we run Python script.
    
    ```python
    sheets = pd.ExcelFile('Lista de e-mails & Email List.xlsx') # use pandas to read excel sheets
    search_sheet = pd.read_excel('Exampl names.xls', header=None)[[2]].rename(columns={2: 'search_name'}) # also use to read search name
    ```
    
    Here, I create function to parse excel sheets and grab all name founded in documents then concat them together
    
    ```python
    def search_through_sheet(sheets, search_term):
        found_name = []
        for sheet_name in sheets.sheet_names:
            df = sheets.parse(sheet_name)
            df['SheetName'] = sheet_name
            found_name.append(df[df['Nome'].map(lambda x: search_term in x.lower())])
        return pd.concat(found_name, axis=0)
    ```
    
    Here, we use the function to look into all `s_terms` in the given file and return dataframe output and sheet name which will be keyword that we use to search.
    
    ```python
    s_terms = map(lambda x: x.lower().strip(), list(search_sheet.search_name)) # search terms from excel file that we have
    
    search_found = []
    for s_term in s_terms:
        df_found = search_through_sheet(sheets, s_term)
        sheet_name_out = s_term
        search_found.append((sheet_name_out, df_found))
    ```
    
    Finally, we write it back into excel sheet, named `search_found.xlsx`.
    
    ```python
    writer = pd.ExcelWriter('search_found.xlsx')
    for (name, df) in search_found:
        df.to_excel(writer, name)
    writer.save() # save to excel sheet
    ```
    
    
    

    external by Johnathan Pulos  97  0  1  0

    Excel Search VBScript

    Excel Search VBScript: excel_search.vbs
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    objStartFolder = "C:\Users\s119588\Documents\TestReports\Test"
    
    '*objStartFolder = "\\Share01\SP\Radiation-Survivability-Engineering\R&SE Section\Parts Database\ToSort\Daniel"
    
    strExcelPath = "C:\Users\s119588\Desktop\results2.xlsx"
    Set objExcel = CreateObject("Excel.Application")
    
    objExcel.DisplayAlerts = False
    
    objExcel.WorkBooks.add()
    Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
    
    Dim RTOfile
    RTOfile ="RPT"
    
    Dim currentRow
    currentRow = 1
    
    '* CREATING THE XLSX HEADER ROW IN BOLD FONT
    objSheet.Cells(currentRow, 1).Value = "Generic P/N"
    
    objSheet.Cells(currentRow, 2).Value = "MFR"
    
    objSheet.Cells(currentRow, 3).Value = "Lot ID"
    
    
    objSheet.Cells(currentRow, 4).Value = "File Size (KB)"
    
    
    objSheet.Cells(currentRow, 5).Value = "File Name"
    
    
    objSheet.Range("1:1").Font.Bold=True
    objSheet.Range("1:1").HorizontalAlignment = -4108
    
    currentRow = currentRow +1
    
    Set objFolder = objFSO.GetFolder(objStartFolder)
    
    
    Dim fullFile
    Set extDictionary = CreateObject("Scripting.Dictionary")
    extDictionary.Add "xls", "xls"
    extDictionary.Add "xlsx", "xlsx"
    extDictionary.Add "xlsm", "xlsm"
    set xlApp = createObject("Excel.Application")
    xlApp.DisplayAlerts= False
    
    
    
    For Each objFile in objFolder.Files
    
    fullFile = objStartFolder & "\" & objFile.name
    Call addROW()
    WScript.Echo "Finished " & objFile.name   
    
    Next
    
    
    ShowSubfolders objFSO.GetFolder(objStartFolder)
    
    
    Sub ShowSubFolders(Folder)
    
        For Each Subfolder in Folder.SubFolders
    
            Set objSubFolder = objFSO.GetFolder(Subfolder.Path)
    
    
            For Each objFile in objSubFolder.Files
    
     	fullFile= Subfolder.Path & "\" & objFile.name
    	Call addROW()        
    	Next
    
    
            ShowSubFolders Subfolder
    
        Next
    
    End Sub
    
    
    
    '* AUTOFIT COLUMNS
    	for column = 1 to 5
      	 	objSheet.columns(column).AutoFit()
    	next
    
    objExcel.ActiveWorkbook.SaveAs(strExcelPath)
    objExcel.ActiveWorkbook.Close
    
    objExcel.Application.Quit
    
    '* addROW() FUNCTION EXTRACTS REQUESTED INFO TO PASTE IN XLSX TABLE
    Function addROW()
        If (extDictionary.Exists(LCase(objFSO.GetExtensionName(objFile.name))) And InStr(Ucase(objFile.name), RTOfile) ) Then
    		On Error Resume Next
    		set Excelbook = xlApp.Workbooks.open(fullFile, False, True)
    			If err.number <> 0 Then
    				Wscript.Echo "The file " & fullFile & " cannot be opened."
    			Else 
    				set Excelworksheet = Excelbook.worksheets(1)
    				'* POPULATE GENERIC P/N
    				objSheet.Cells(currentRow, 1).value = Excelworksheet.Cells(4,5).Value
    
    				'* POPULATE MFR
    				objSheet.Cells(currentRow, 2).value = Excelworksheet.Cells(3,9).Value
    
    				'* POPULATE LOT ID
    				objSheet.Cells(currentRow, 3).value = Excelworksheet.Cells(4,9).Value
    
    				'* POPULATE FILE SIZE
    				objSheet.Cells(currentRow, 4).Value = Round(objFile.size/1024) 
    				'* POPULATE FILE NAME W/ URL
    				objSheet.Cells(currentRow, 5).Value = "=HYPERLINK(""" & fullFile & """,""" & fullFile & """)"
    				objSheet.rows(currentRow).HorizontalAlignment = -4131
    			End If
      	 		
    
    	Excelbook.Close
    	currentRow = currentRow+1
    
        End If
    
        On error GoTo 0	
    End Function
    
    

    external by sagarlolla  0  0  1  0

    Create Excel, Open Excel, Write data in it, Read values, Search for a value

    Create Excel, Open Excel, Write data in it, Read values, Search for a value: ExcelOperations.vbs
    Dim objExcel
    Dim objWorkBook
    Dim objWorkSheet
    Dim intRow
    Dim intCol
    Dim strPath : strPath ="D:\EmpData.xlsx"
    
    'Create a new excel file under a given path
    Set objExcel = CreateObject("Excel.Application")
    Set objWorkBook = objExcel.Workbooks.Add
    objWorkBook.SaveAs strPath
    
    'Open excel file, write data in it, save and close
    objExcel.Workbooks.Open strPath
    Set objWorkSheet=objExcel.Worksheets("Sheet1")
    objWorkSheet.Cells(1,1)= "EmpId"
    objWorkSheet.Cells(1,2)= "EmpName"
    objWorkSheet.Cells(1,3)= "Dept"
    objWorkSheet.Cells(1,4)= "Gender"
    objWorkSheet.Cells(2,1)= "786"
    objWorkSheet.Cells(2,2)= "Peter"
    objWorkSheet.Cells(2,3)= "ITQA"
    objWorkSheet.Cells(2,4)= "M"
    objExcel.ActiveWorkbook.Save
    
    'Read values from excel workbook
    intRow=objWorkSheet.UsedRange.Rows.Count
    intCol=objWorkSheet.UsedRange.columns.count
    For  i= 1 to intRow
        For j=1 to intCol
            Msgbox  objWorkSheet.cells(i,j).value
        Next
    Next
    
    'Search for a value in excel
    For each  tempValue in objWorkSheet.UsedRange
    	If tempValue = "Peter" Then
    		msgbox "Search Item found"
    	End If
    Next
    
    objExcel.ActiveWorkbook.Close
    objExcel.Quit
    Set objExcel =  Nothing
    
    

    List Complete ( 6 snippets total )

    • Public Snippets
    • Channels Snippets