Item rows into order sheet

H

HBj

Hello everybody

I have an Excel (2000) project the part of whitch is to print out an order
with a list of items for that particular order number. I have a sheet with
columns OrderNumber, Item, Description, Qty and Prize.
In the Order sheet I enter the order number and want a macro to copy the
corresponding items rows to the order sheet.

I manually enter only the order number in a validation list box and want
this to trigger reading the items. I did it with Autofilter, but how to
scroll the autofilter list down. Copy an paste is not possible - but I want
to cell by cell copy the item information rows.

Sounds very simple - but I got stuck with it...
 
S

Sheeloo

If you enter the order number in A1 then you can use the following to trigger
the processing (add it to the worksheet's code)

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
If Target.Address = "$A$1" Then
'do your stuff
End If
End Sub

Or you can simply use VLOOKUP based on the value in A1 ....
 
S

Sheeloo

Sorry pasted the code for the wrong event...

Use this
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$3" Then
'do your stuff
End If
End Sub
 
R

royUK

Sheeloo;269928 said:
If you enter the order number in A1 then you can use the following to
trigger
the processing (add it to the worksheet's code)

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target
As Range)
If Target.Address = "$A$1" Then
'do your stuff
End If
End Sub

Or you can simply use VLOOKUP based on the value in A1 ....

I think it's the do your stuff the OP wants!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top