Results 1 to 2 of 2
  1. #1
    crownedzero is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    19

    Convert Excel Macro to Access Query

    Code:
    Sub Remove_NoStock()
    Dim i As Long
    Application.ScreenUpdating = False
    For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
        If Cells(i, 3) = "D" And _
        Application.WorksheetFunction.SumIf(Range("A:A"), Cells(i, 1), Range("G:G")) = 0 Then
            Cells(i, 1).EntireRow.Delete
        End If
    Next
    Application.ScreenUpdating = True
    End Sub
    Column "A" is the ItemNumber but there are multiple sizes of with the same ItemNumber, for each ItemNumber that has 0 in the "G"
    Available column for ALL sizes these records do not need to be returned.



    Suggestions? Thanks in advance.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How about just describing in English what records need to be deleted and maybe those of us not fluent in SpreadSheet will understand.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Macro To Import CSV to ACCESS
    By csvivek in forum Import/Export Data
    Replies: 1
    Last Post: 12-07-2009, 01:49 PM
  2. Replies: 0
    Last Post: 05-07-2009, 02:32 PM
  3. Replies: 0
    Last Post: 12-28-2008, 01:56 PM
  4. Convert string to date
    By ~SwAmPdOnKeY~ in forum Queries
    Replies: 4
    Last Post: 09-11-2008, 07:19 PM
  5. Replies: 0
    Last Post: 01-01-2007, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums