Answer the question
In order to leave comments, you need to log in
How to show certain data on click on a line?
I have Excel 2007, if the task is not solved on it, I can install another version.
An implementation on Google Sheets is also suitable.
There are 3 sheets: Managers, Clients and Orders.
How to make the data change at the top when clicking on a line with products.
The data is linked by client id and manager id.
On the last picture, the click was on the "Meat" cell, the data should be on top as shown in the picture.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("D5:E9"), Target) Is Nothing Then Exit Sub
Range("B1").Value = "=ВПР(B" & ActiveCell.Row & ";клиенты!A:C;2;0)"
Range("C1").Value = "=ВПР(B" & ActiveCell.Row & ";клиенты!A:C;3;0)"
Range("B2").Value = "=ВПР(С" & ActiveCell.Row & ";менеджеры!A:C;2;0)"
Range("C2").Value = "=ВПР(С" & ActiveCell.Row & ";менеджеры!A:C;3;0)"
End Sub
=ВПР(B5;клиенты!A:C;2;0)
Answer the question
In order to leave comments, you need to log in
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("D5:E9"), Target) Is Nothing Then Exit Sub
Range("B1").FormulaLocal = "=ВПР(B" & ActiveCell.Row & ";клиенты!A:C;2;0)"
Range("C1").FormulaLocal = "=ВПР(B" & ActiveCell.Row & ";клиенты!A:C;3;0)"
Range("B2").FormulaLocal = "=ВПР(C" & ActiveCell.Row & ";менеджеры!A:C;2;0)"
Range("C2").FormulaLocal = "=ВПР(C" & ActiveCell.Row & ";менеджеры!A:C;3;0)"
End Sub
You need to write macros in vba. By changing the cell on the SelectionChange event
https
://stackoverflow.com/questions/23473721/execu...
each time the cursor is moved, it is checked against the condition\holes, and the necessary actions are performed.
But generally it is a perversion, for this purpose Access is.
For Google sheets there is onSelectionChange (event).
let value = range.getCell(1, 1).getValue()
data.filter(row=>row[0]===value)
range.setValues(outData)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question