mysticmario
Active Member
- Joined
- Nov 10, 2021
- Messages
- 323
- Office Version
- 365
- Platform
- Windows
Hi, I am using a code to find a cell value and then take the adjacent cell value to my report document: this is the code:
It works great but now I encountered a problem where i have multiple instances of this value in column. let's say the value is called "painting the element", I want to find all instances of this value in the column D, sum it up and "ship" it to Sheets(LastSheet).Range("R25")
Can't wrap my head around how to do it.
anyone can help?
VBA Code:
'2.ORGANZIACJA'
ActiveSheet.Columns("D:D").Select
Set Cell = Selection.Find(what:="ORGANIZACJA", after:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Cell Is Nothing Then
Sheets(LastSheet).Range("S12").Value = 0
Sheets(LastSheet).Range("T12").Value = 0
Else
Sheets(LastSheet).Range("S12").Value = Cell.Offset(0, 1).Value
Sheets(LastSheet).Range("T12").Value = Cell.Offset(0, 3).Value
End If
'------'
It works great but now I encountered a problem where i have multiple instances of this value in column. let's say the value is called "painting the element", I want to find all instances of this value in the column D, sum it up and "ship" it to Sheets(LastSheet).Range("R25")
Can't wrap my head around how to do it.
anyone can help?
Last edited: