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

  • SEARCH
  • Home
  • 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 8175067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:38:00+00:00 2026-06-06T22:38:00+00:00

I normally do most of this work in Excel 2007, but I do not

  • 0

I normally do most of this work in Excel 2007, but I do not think excel is the right tool for managing the data that I need to process. So I am trying to convert an excel spreadsheet to an Access 2007 db which I can do with no problem, but before doing anything to the spreadsheet I go through the process of cleaning up the data in it in order to use the resulting information. In excel I use a macro such as the following

Sub deletedExceptions_row()
    Dim i As Long
    Dim ws As Worksheet

    On Error GoTo whoa

    Set ws = Sheets("data") 

    With ws
        For i = .Cells.SpecialCells(xlCellTypeLastCell).Row To 1 Step -1
            If .Cells(i, 3) = "" Or _
              VBA.Left(.Cells(i, 3), 4) = "511-" Or _
              VBA.Left(.Cells(i, 3), 5) = "CARL-" Then
                .Rows(i).Delete
            End If
        Next i
    End With
    Exit Sub
whoa:
    MsgBox "Value of i is " & i
End Sub

to remove unnecessary records in the spreadsheet how would I accomplish the same thing in Access 2007.

The macro is looking for particular parts or rather the first few characters of the record’s 3rd field in order to determine if the whole record needs to be removed (ex. 511-QWTY-SVP or CARL-52589-00). In all there about 180 such character types that affect 1000’s of rows that need to be removed from the spreadsheet, but I would like to replicate that same process in Access 2007, but do not know how.

Thank you all for your assistance with this problem

  • 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-06T22:38:02+00:00Added an answer on June 6, 2026 at 10:38 pm

    Within Access you can execute a DELETE statement to discard rows where the value in a field is an empty string (“”) or matches one of your patterns.

    DELETE FROM YourTable
    WHERE
           YourField = ""
        OR YourField ALike "511-%"
        OR YourField ALike "CARL-%";
    

    With YourField indexed, that pattern matching in the WHERE clause offers a potentially large performance improvement over a query using the Left() function such as your spreadsheet macro used. IOW, the following query would require the db engine to run those Left() expressions on every row of YourTable. But with the query above and YourField indexed, the db engine could simply select the matching rows … which can easily be an order of magnitude faster.

    DELETE FROM YourTable
    WHERE
           YourField = ""
        OR Left(YourField, 4) = "511-"
        OR Left(YourField, 5) = "CARL-";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I normally work with jQuery, which takes away most of the cross browser pain
I do a lot of work with very large spreadsheet data (most of which
This is a weird situation and I normally would never do it but our
Pretty sure this question counts as blasphemy to most web 2.0 proponents, but I
Normally most of the MFC (window based classes) are derived from CObject. What does
Normally, if I want to start a new activity I can use StartActivity(typeof(foo)); This
Normally the XML files I have to parse are like this: <row id=1> <title>widget<title>
My game normally uses GL_TEXTURE_RECTANGLE_EXT to draw 2D textures. However, since this isn't supported
I am normally a firm believer of using namespaces (qualified module names) in most
I would like to know how you normally deal with this situation: I have

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.