PresidentEvil
New Member
- Joined
- Jan 2, 2021
- Messages
- 34
- Office Version
- 2021
- 2016
- Platform
- Windows
Hi,
I have a macro created by one of my former colleagues. It a bit complex macro with multiple steps which includes application of mutiple formula. He is no longer working for us, and we have decided to move to power automate with Office scripts. I have been decoding each step and converting them into office script however one such step is very difficult to understand (at least for me). Any help on this will be highly appreciated.
Below is a part of macro that he designed. Not able to understand what's going on in this...any explanation step by step would be really helpful
I have a macro created by one of my former colleagues. It a bit complex macro with multiple steps which includes application of mutiple formula. He is no longer working for us, and we have decided to move to power automate with Office scripts. I have been decoding each step and converting them into office script however one such step is very difficult to understand (at least for me). Any help on this will be highly appreciated.
Below is a part of macro that he designed. Not able to understand what's going on in this...any explanation step by step would be really helpful
VBA Code:
Sub test()
Range("J4:M4").Select 'Range J4 to M4 has formula
Range(Selection, Selection.End(xlDown)).Select
Range("Z2") = Selection.Row + Selection.Rows.Count - 1
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Selection.Replace What:="Check", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="Check", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Selection.SpecialCells(xlCellTypeBlanks).Select
Application.CutCopyMode = False
'Selection.FormulaR1C1 = "=R[1]C"
Range(Range("Z3")).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = _
"=IF(ISNA(MATCH(CONCATENATE(C[-9],""Text""),C[4],0)),"""",R[1]C)"
'mutiple formulas like the above
End Sub