Consulting

Results 1 to 3 of 3

Thread: Help needed!!!!

  1. #1
    VBAX Regular
    Joined
    May 2008
    Posts
    11
    Location

    Help needed!!!!

    Hi i am currently working on a excel formular,
    and i am stuck, need some help from you guys.

    I need to check if the "Order Number" is complete or Not Complete,
    however checking by manual is very hard.

    So i would like to check if you guys can help on this.
    I have attached the excel for reference.
    anyone can help by using excel formular or marco is appreciate.

    I did some explaination in the excel attached.
    Kindly help

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Public Sub ProcessData()
    Const TEST_COLUMN As String = "B" '<=== change to suit
    Dim i As Long
    Dim LastRow As Long
    Dim NextItem As Long
    Dim BreakIndex As Long
    Dim aryItems As Variant

    With ActiveSheet

    LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
    ReDim aryItems(1 To LastRow)
    For i = 1 To LastRow

    If .Cells(i, TEST_COLUMN).Offset(0, 1).Value = "Not Complete" Then

    If IsError(Application.Match(.Cells(i, TEST_COLUMN).Value, aryItems, 0)) Then

    NextItem = NextItem + 1
    aryItems(NextItem) = .Cells(i, TEST_COLUMN).Value
    End If
    End If
    Next i

    BreakIndex = NextItem

    For i = 1 To LastRow

    If .Cells(i, TEST_COLUMN).Offset(0, 1).Value = "Complete" Then

    If IsError(Application.Match(.Cells(i, TEST_COLUMN).Value, aryItems, 0)) Then

    NextItem = NextItem + 1
    aryItems(NextItem) = .Cells(i, TEST_COLUMN).Value
    End If
    End If
    Next i

    For i = 1 To NextItem

    .Cells(i + 3, "F").Value = aryItems(i)
    .Cells(i + 3, "G").Value = IIf(i > BreakIndex, "", "Not ") & "Complete"
    Next i
    End With

    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Public Sub ProcessData()
    Const TEST_COLUMN As String = "B" '<=== change to suit
    Dim i As Long
    Dim LastRow As Long
    Dim NextItem As Long
    Dim BreakIndex As Long
    Dim aryItems As Variant

    With ActiveSheet

    LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
    ReDim aryItems(1 To LastRow)
    For i = 1 To LastRow

    If .Cells(i, TEST_COLUMN).Offset(0, 1).Value = "Not Complete" Then

    If IsError(Application.Match(.Cells(i, TEST_COLUMN).Value, aryItems, 0)) Then

    NextItem = NextItem + 1
    aryItems(NextItem) = .Cells(i, TEST_COLUMN).Value
    End If
    End If
    Next i

    BreakIndex = NextItem

    For i = 1 To LastRow

    If .Cells(i, TEST_COLUMN).Offset(0, 1).Value = "Complete" Then

    If IsError(Application.Match(.Cells(i, TEST_COLUMN).Value, aryItems, 0)) Then

    NextItem = NextItem + 1
    aryItems(NextItem) = .Cells(i, TEST_COLUMN).Value
    End If
    End If
    Next i

    For i = 1 To NextItem

    .Cells(i + 3, "F").Value = aryItems(i)
    .Cells(i + 3, "G").Value = IIf(i > BreakIndex, "", "Not ") & "Complete"
    Next i
    End With

    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •