excel formula to move to next row if cell is blank, if cell not blank return answer in different column

I have several sheets with pricelists. If i put a numerical value against any of the items, I want this information to be replicated in the first sheet (the purchase order).

So just say we have:
      1         2                     3       4  
A Item  Description  Qty  Price
B AA12   Widget 1A              $50
C AB14   Widget 4B      1      $50

In another sheet I want only the details from the row c to appear as there is "1" put in the qty column. So if there is a number in column 3, return the Item details. Keep going through all the sheets only returning rows with numbers in the qty column.
noobiedooAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
can you provide samples of As-Is and To-Be in an Excel file?
0
noobiedooAuthor Commented:
Here is a sample spreadsheet of what I have:Purchase-Order-from-Price-List---Te.xlsx

And here is a sample of what I need it to look like: Purchase-Order-from-Price-List---Te.xlsx

Thanks :)
0
Ryan ChongCommented:
you may test and verify this:

Type item
    itm As String
    desc As String
    qty As Integer
    buyprice As Currency
    totalcost As Currency
End Type

Sub updatePO()
    Dim arr() As item
    Dim idx As Integer
    Dim ws As Worksheet
    idx = -1
    For Each ws In Worksheets
        With ws
        If .Name Like "Price*" Then
            'Debug.Print ws.Name
            i = 5
            cnt = 0
            Do While cnt < 5
                If .Cells(i, 3) = "" Then
                    cnt = cnt + 1
                Else
                    itm = .Cells(i, 3)
                    desc = .Cells(i, 4)
                    qty = .Cells(i, 7)
                    buyprice = .Cells(i, 8)
                    totalcost = .Cells(i, 9)
                    
                    If qty <> "" Then
                        isFound = False
                        If idx >= 0 Then
                            For j = 0 To UBound(arr)
                                If arr(j).itm = itm Then
                                    arr(j).qty = arr(j).qty + qty
                                    arr(j).totalcost = arr(j).totalcost + totalcost
                                    Exit For
                                End If
                            Next
                        End If
                        If isFound = False Then
                            idx = idx + 1
                            ReDim Preserve arr(idx)
                            arr(idx).itm = itm
                            arr(idx).desc = desc
                            arr(idx).qty = qty
                            arr(idx).buyprice = buyprice
                            arr(idx).totalcost = totalcost ' qty * buyprice
                        End If
                    End If
                    cnt = 0
                    
                End If
                i = i + 1
            Loop
        End If
        End With
    Next
    'Contruct consolidate PO
    Worksheets("ORDER").Range("C5:I34").ClearContents
    i = 5
    For j = 0 To UBound(arr)
        Cells(i, 3) = arr(j).itm
        Cells(i, 4) = arr(j).desc
        Cells(i, 7) = arr(j).qty
        Cells(i, 8) = arr(j).buyprice
        Cells(i, 9) = arr(j).totalcost
        i = i + 1
    '    Debug.Print arr(i).itm & " , " & arr(i).desc & " , " & arr(i).qty & " , " & arr(i).buyprice & " , " & arr(i).totalcost
    Next
End Sub

Open in new window

Purchase-Order-from-Price-List---Te.xlsm
1
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Please find the attached workbook which contains a sheet change code on Thisworkbook module.
As per the code if you input the Qty of a item in col. G, that record will be shown on the ORDER sheet.

Is this what you are trying to achieve?
Purchase-Order-from-Price-List.xlsm
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.