PDA

View Full Version : Macro to copy a cell value and put in different worksheet



Goldyyy
10-29-2020, 01:30 AM
This one will be interesting. Basically I want to know if this is even possible.
https://i.stack.imgur.com/kPgAG.png (https://i.stack.imgur.com/kPgAG.png)
https://i.stack.imgur.com/09IaL.png (https://i.stack.imgur.com/09IaL.png)
The first step should be reading the cell value "L3" and in the image below it's 25, but it might change. The next step should be checking what is it attached as you can see for the second step in "A3" it is attached to "SR 1". Then I have this other sheet which is called "Risku karte" as you can see in the 3rd and 4th step. For now it shows you that it is a different workbook, but all of it will be in the same workbook. So in this sheet the task is to put a small thing, like a text or something in this case "SR 1" to it's attached number which is 25. You can see how it looks in the image on right. I don't know how that would work, tell me if that's even possible. Maybe to put like a text icon or something, I really don't know.
I genuinely don't know if this is possible, but at the same time it doesn't sound that bad, but I have no idea what to do as I am no VBA expert, not even close.
There are like 96 rows of different values and if someone changes the value of column "L" it should automatically put these small icons/images/text in other sheet according to the value.
I did quite a lot of research on how could I maybe do this, but without success.
I would love all the help I could get regarding this problem, and if there is any questions, please ask.
Thank you so much in advance!


THIS IS WHAT I'VE TRIED SO FAR, IT RUNS, BUT IT DOESN'T DO ANYTHING.


Sub CopyIt()


Application.ScreenUpdating = False




With ActiveSheet
.AutoFilterMode = False
With Range("L1", Range("L" & Rows.Count).End(xlUp))
.AutoFilter 1, "25"
On Error Resume Next
Riskukarte.Range("G").End(xlUp).PasteSpecial xlPasteValues
End With
.AutoFilterMode = False
End With


Application.ScreenUpdating = True
Application.CutCopyMode = False
Riskukarte.Select


End Sub