Ammarbokhari
Board Regular
- Joined
- Apr 21, 2011
- Messages
- 55
Hi,
I am at below zero level when it comes to VBA so what you see is a recorded macro, which I failed to complete.
What this macro is supposed to do, is to search within given row (say Row7) for given value and when match (find) occurs, value at offset of 1 column is to be taken and added to the value which will come at next match (Find).
The initial modifications required in the below code are:
It should search within one row at a time, and when end of row is reached, it should stop.
When match occurs, pick the value next to matched cell.
Match (find) again, and the value next to matched cell added to the previous value, and repeat the process to the end of row or end of selection (which can be manually given (i.e to column AZ in row7).
Sub Macro3()
'
' Macro3 Macro
'
'
Cells.Find(What:="QTJ-001", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
End Sub
Thank you all in advance.
I am at below zero level when it comes to VBA so what you see is a recorded macro, which I failed to complete.
What this macro is supposed to do, is to search within given row (say Row7) for given value and when match (find) occurs, value at offset of 1 column is to be taken and added to the value which will come at next match (Find).
The initial modifications required in the below code are:
It should search within one row at a time, and when end of row is reached, it should stop.
When match occurs, pick the value next to matched cell.
Match (find) again, and the value next to matched cell added to the previous value, and repeat the process to the end of row or end of selection (which can be manually given (i.e to column AZ in row7).
Sub Macro3()
'
' Macro3 Macro
'
'
Cells.Find(What:="QTJ-001", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
End Sub
Thank you all in advance.