Look at what i have done on sheet 2 manually , raw data on sheet1
Find attached
Look at what i have done on sheet 2 manually , raw data on sheet1
Find attached
As usual, you offer no explanation in WORDS: do you require ALL purchases? and do we separate out the entry you have in column A?
Please provide a better sample.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
Yellow is the Key for which macro should search , i asked for SANTA LUCIA , there are 1ooo products
For "SANTA LUCIA", simply filter on "SANTA LUCIA" in column B.
What is in column A for these ..????
MAJI MASAFI 350 ML - 1 X 24
MAJI MASAFI 600ML - 1 X 12
MAJI MASAFI 12LTR
MAJI MASAFI 17LTR
or
BIG BOM LOLLYPOP X 14
Guessing ....
Please Login or Register to view this content.
Last edited by JohnTopley; 10-30-2023 at 04:44 PM.
So from where do type the filter say another item ?
Another option. Trigger any change in cell A1 sheet2.
Change A1 to get the updated results.
Put this code in sheet2 module
PHP Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr&, i&, k&, rng, dat As Date, res(1 To 10000, 1 To 4)
If Target.Address(0, 0) <> "A1" Then Exit Sub
With Sheets("Sheet1")
lr = .Cells(Rows.Count, "B").End(xlUp).Row
rng = .Range("A3:D" & lr).Value
End With
For i = 1 To UBound(rng)
If IsDate(rng(i, 1)) Then dat = rng(i, 1)
If rng(i, 2) = Target.Value Then
k = k + 1: res(k, 1) = dat: res(k, 2) = Target.Value
res(k, 3) = rng(i, 3): res(k, 4) = rng(i, 4)
End If
Next
Range("C1:F10000").ClearContents
If k > 0 Then Range("C1").Resize(k, 4).Value = res
Columns("A:F").AutoFit
End Sub
Quang PT
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks