VBA Script for AutoFill based on criteria VLOOKUP()

apamix

New Member
Joined
Apr 1, 2018
Messages
1
Hello everybody,
This is how looks my table (for better view look here)

table.jpg


My goals here are :

When somebody enters a data in SKU column which is matching to already existing one the new data will go one roll below the old data and copy several details like Description, Unit, Cost, Inventory Value. In the perfect scenario, the Reorder Qty in the duplicated data will be 0 and the Reorder will be calculated based on total Qty from the SKU.

So far I was able to sort if the newly entered data in column b is matching to something already exist will go to one row below with this VBA script:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
    If Not Intersect(Target, Range("B:B")) Is Nothing Then
        Range("B5").Sort Key1:=Range("B6"), _
          Order1:=xlAscending, Header:=xlYes, _
          OrderCustom:=1, MatchCase:=False, _
          Orientation:=xlTopToBottom
    End If
End Sub

So I think the next is to get some AutoFill values ( Description, Unit, Cost, Inventory Value ) based on matching criteria ( SKU ), but so far I'm unable to build it :( Any help will be appreciated.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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