Results in Cell Only if Selected

jamesmev

Board Regular
Joined
Apr 9, 2015
Messages
233
Office Version
  1. 365
Platform
  1. Windows
I have an order form where I have over 1000 items.
I want the output on Sheet2 to only provide the quantity and Item Code

Sheet1 Source " Item Code " K16:K999
Quantity C16:C999

Results on Sheet2

Any assistance would be great.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
assuming you would want them to appear on sheet2 column A & B (else just relocate the formula)
on the cell of sheet2 starting A2: =sheet1!K16 - copy down
on B2: =sheet1!C16 - copy down
hope this helps
thanks..
 
Upvote 0
I didn’t specify.
If on sheet 1 you add a quantity of product.
Sheet 2 will only show product # and quantity of only items with a quantity assigned.

Example:
Sheet1. Has 1000 product options

Order is placed
10 widgets
5 cogs
3 whahuzits
4 thingamabobs

Sheet 2 only returns
The items ordered on sheet 1
 
Upvote 0
kindly see the sample:
https://www.dropbox.com/s/9brdneojl1suzhz/jamesmev.xlsm?dl=0

Try the following code in another workbook -- do not test this directly on your work.
Hope this helps
thanks..

Code:
Sub UpdateData()
    Sheets("Sheet2").Select
    mlr2 = Cells(Rows.Count, "A").End(xlUp).Row
    mlr2 = mlr2 + 1
    Sheets("Sheet1").Select
    mlr1 = Cells(Rows.Count, "C").End(xlUp).Row
    Application.ScreenUpdating = False
    On Error Resume Next
    Dim i As Long
    For i = 16 To mlr1
        If Cells(i, "C") > 0 Then
             mqty = Cells(i, "C")
             mitem = Cells(i, "K")
             Sheets("Sheet2").Select
             Sheets("Sheet2").Range("A" & mlr2).Select
             Cells(mlr2, "A") = mqty
             Cells(mlr2, "B") = mitem
             mlr2 = mlr2 + 1
        End If
        Sheets("Sheet1").Select
    Next i
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    On Error GoTo 0
    Sheets("Sheet2").Select
    Sheets("Sheet2").Range("A2").Select
End Sub
 
Upvote 0
kindly see the sample:
https://www.dropbox.com/s/9brdneojl1suzhz/jamesmev.xlsm?dl=0

Try the following code in another workbook -- do not test this directly on your work.
Hope this helps
thanks..

Code:
Sub UpdateData()
    Sheets("Sheet2").Select
    mlr2 = Cells(Rows.Count, "A").End(xlUp).Row
    mlr2 = mlr2 + 1
    Sheets("Sheet1").Select
    mlr1 = Cells(Rows.Count, "C").End(xlUp).Row
    Application.ScreenUpdating = False
    On Error Resume Next
    Dim i As Long
    For i = 16 To mlr1
        If Cells(i, "C") > 0 Then
             mqty = Cells(i, "C")
             mitem = Cells(i, "K")
             Sheets("Sheet2").Select
             Sheets("Sheet2").Range("A" & mlr2).Select
             Cells(mlr2, "A") = mqty
             Cells(mlr2, "B") = mitem
             mlr2 = mlr2 + 1
        End If
        Sheets("Sheet1").Select
    Next i
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    On Error GoTo 0
    Sheets("Sheet2").Select
    Sheets("Sheet2").Range("A2").Select
End Sub


I am not getting any result running this code. Any direction?
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top