Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9230985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:57:24+00:00 2026-06-18T05:57:24+00:00

I have a worksheet, I need to delete rows based on cell value ..

  • 0

I have a worksheet, I need to delete rows based on cell value ..

Cells to check are in Column A ..

If cell contains “-” .. Delete Row

I can’t find a way to do this .. I open a workbook, copy all contents to another workbook, then delete entire rows and columns, but there are specific rows that has to be removed based on cell value.

Need Help Here.

UPDATE

Sample of Data I have

Sample

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:57:26+00:00Added an answer on June 18, 2026 at 5:57 am

    The screenshot was very helpful – the following code will do the job (assuming data is located in column A starting A1):

    Sub RemoveRows()
    
    Dim i As Long
    
    i = 1
    
    Do While i <= ThisWorkbook.ActiveSheet.Range("A1").CurrentRegion.Rows.Count
    
        If InStr(1, ThisWorkbook.ActiveSheet.Cells(i, 1).Text, "-", vbTextCompare) > 0 Then
            ThisWorkbook.ActiveSheet.Cells(i, 1).EntireRow.Delete
        Else
            i = i + 1
        End If
    
    Loop
    
    End Sub
    

    Sample file is shared: https://www.dropbox.com/s/2vhq6vw7ov7ssya/RemoweDashRows.xlsm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find how many rows in worksheet have been defined. How can
I have a worksheet with protected cells. There's an 'add row' button and I
I have a worksheet with many rows/columns like so: How can I only copy
I have a worksheet with 50 rows & 10 column. One of the column
I have 2 worksheets, I need to update with data from another worksheet I
I need to delete certain rows from an excel file. The excel file is
I have a Excel addin that displays some structures on the worksheet. Users can
I have a need to copy a worksheet from one workbook into another and
I have a single excel worksheet which contains lots of table definitions around 50.
I need to only delete cells 7B:7G, while leaving 7A alone. How do I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.