Hello,
I have a Table as shown on the attached spreadsheet.
I have a variable defined as MyCurrentCateg = "Fruit"
I want a message box to display all the Fruits; The corresponding Price; the corresponding Vendor.
Could you please help?
Thanks
Hello,
I have a Table as shown on the attached spreadsheet.
I have a variable defined as MyCurrentCateg = "Fruit"
I want a message box to display all the Fruits; The corresponding Price; the corresponding Vendor.
Could you please help?
Thanks
Without seeing your code, a demonstration as a beginner starter :
PHP Code:
Sub Demo()
Const F = "TRANSPOSE(IF(#=""¤"",ROW(#)))"
Dim C$, V, R&
C = "Fruit"
With Sheet1.UsedRange
If Application.CountIf(.Columns(1), C) = 0 Then Beep: Exit Sub
V = .Parent.Evaluate(Replace$(Replace$(F, "#", .Columns(1).Address), "¤", C))
V(1) = 1
V = Application.Index(.Value2, Application.Transpose(Filter(V, False, False)), [{2,3,4}])
End With
For R = 1 To UBound(V)
V(R, 1) = V(R, 1) & String(2 + (Len(V(R, 1)) > 9), vbTab) & V(R, 2) & vbTab & V(R, 3)
Next
MsgBox Join(Application.Transpose(Application.Index(V, , 1)), vbLf), , C
End Sub
Do you like it ? So thanks to click on bottom left star icon « ★ Add Reputation » !
Last edited by Marc L; 06-22-2019 at 08:59 PM. Reason: adding a control …
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks