How to Extract Record with Not Criteria through Excel VBA?
Tags: toextractrecordwithn, vbamacros
Published: 2021-09-14 12:40:18

---
title: How to Extract Record with Not Criteria through Excel VBA?
published: true
date: 2021-09-13 12:15:14 UTC
tags: ToExtractRecordWithN,VBAMacros
canonical_url: https://geekexcel.com/how-to-extract-record-with-not-criteria-through-excel-vba/
---

In this tutorial, we will guide you on  **how to extract the record with no criteria through Excel VBA**. Let’s get them below!! Get an official version of MS Excel from the following link: **[https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)**

## Example

- Firstly, in the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-8-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you need to  **insert a module**.
- After that, you have to go to  **insert menu**  and click on  **procedure** , where you will get the procedure if you don’t know how it should be started the  **macro**.
- You have to  **copy and paste**  the following code.

```
Sub Delete_NotEligible()
ActiveSheet.Range("$A$1:$G$15").AutoFilter Field:=7, Criteria1:="<>"
Rows("2:12").Select
Selection.Delete Shift:=xlUp
Range("B1").Select
Selection.AutoFilter
End Sub

```

- After that, you need to  **save the code**  by selecting it and then  **close the window**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code-32.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-8-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://geekexcel.com/wp-content/uploads/2021/09/Run-the-Code-16.png)<figcaption>Run the Code</figcaption>

- Finally, you will get  **output ** as given below in the  **Microsoft Excel**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Output-7-1024x208.png)<figcaption>Output</figcaption>

## Conclusion

We hope that this short tutorial gives you guidelines on **how to extract the record with no criteria through Excel VBA. ** Please leave a comment in case of any  **queries,**  and don’t forget to mention your valuable  **suggestions**  as well. Thank you so much for Visiting Our Site!! Continue learning on **[Geek Excel](https://geekexcel.com/)!! **Read more on [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

**Continue Reading:**

- **[Excel Formulas to Find the Same Date in Next Year ~ Simple Guide!!](https://geekexcel.com/excel-formulas-to-find-the-same-date-in-next-year/)**
- **[Enter the Date in Excel Sheet ~ Step-by-Step Procedure!!](https://geekexcel.com/enter-the-date-excel/)**
- **[Find the Nth Largest Value in Excel Office 365 ~ Step-By-Step Procedure!!](https://geekexcel.com/find-the-nth-largest-value-in-excel/)**
- **[How to Extract Text Before Nth Specific Character in Excel?](https://geekexcel.com/extract-text-between-nth-specific-character-excel/)**
- **[Excel Formulas to Extract the Time from Date and Time ~ Quick Method!!](https://geekexcel.com/excel-formulas-to-extract-the-time-from-date-and-time/)**