Giter Site home page Giter Site logo

searchmacro's Introduction

SearchMacro

Uses Visual Basic to search through an excel spreadsheet

How to use

In order to use this script as intended, one must first create a Searchbook in Excel.

Preliminary Steps

  1. To create a searchbook in Excel, simply open up a new Excel document and click on the tab on the far right that says "View"
  2. Click on the "Macros" icon on the far right hand side.
  3. Enter the name "Search"; it is important that you type search in the same case as in the quotes, otherwise the function will not run properly (do not include the quotes).
  4. Click the "Create" button or press return/enter
  5. Delete anything in the window (sub search/end sub)
  6. Open the “Search Macro.vb” file in notepad, this will ensure that the text is not tampered with.
  7. Copy + Paste the entire “Search Macro.vb” file into the window which popped up in step 4 and 5
  8. Save the pasted data (click the save button or press CTRL+S)
  9. Exit out of the window that popped up (click the “X” in the top right-hand corner)

Main Steps

  1. Copy all the data over to the Searchbook.
  2. After this, a new line must be inserted at the top of the CSV. In this line, input the title of the column with the the data you want to search. You should also
    • If you do not have a second sheet in your searchbook already, create a second sheet in it by clicking the “+” icon at the bottom of the window.
  3. Next, a list of data to be compared should be pasted in a column list in only the first column of the second sheet.
  4. After this, the macro can be run safely, and will copy the entire row of data from the first sheet that match the second sheet into a newly created third sheet.
    • In order to run the macro, click on "Macros" again under the "View" tab
    • Click on your "Search" Macro that we defined earlier, and click "Run"
    • If you are presented with any security prompts, allow the macro access
    • Wait. Depending on the volume of data, there may be a few seconds of run time.

Final Steps

  1. To save this workbook as a Macro-enabled workbook, click on the "File" tab in the top left-hand corner in Excel
  2. Click "Save As" in the window that opens up
  3. From the drop-down menu select "Excel Macro-enabled Workbook (*.xlsm)" and click "Save"
  4. Now your workbook will be able to be reused

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.