Hello VBA Superiors!
I am working with a workbook that uses a index/match formula with a few named ranges. my current code works just fine, but I would love to simplify it. I am aware I could put in a single code to drag the formula across the entire used range of the worksheet, but what I'm trying to avoid is the extensive time it takes to process everything. The audience I am preparing this for can be very impatient, and I would like to have a process that shows some sort of progressive results as it goes (unless there is actually a way to significantly cut the process time). Below is a sample of the code I am using. It starts with column B and continues on to column AQ.
Thank you to anyone taking the time to even glance at my novice VBA skills. I am here to learn.
I am working with a workbook that uses a index/match formula with a few named ranges. my current code works just fine, but I would love to simplify it. I am aware I could put in a single code to drag the formula across the entire used range of the worksheet, but what I'm trying to avoid is the extensive time it takes to process everything. The audience I am preparing this for can be very impatient, and I would like to have a process that shows some sort of progressive results as it goes (unless there is actually a way to significantly cut the process time). Below is a sample of the code I am using. It starts with column B and continues on to column AQ.
Thank you to anyone taking the time to even glance at my novice VBA skills. I am here to learn.
Code:
Sub convert()
'
Sheets("Reviews").Select
Dim LastRow As Long
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("B4").Select
Selection.FormulaArray = _
"=IFERROR(IF(INDEX(allofit,MATCH(1,(Name=RC1)*(SOP=R2C),0),7)=""Acquired"",""X"",IF(INDEX(allofit,MATCH(1,(Name=RC1)*(SOP=R2C),0),7)=""Overdue"",""O"",""--"")),"" "")"
Selection.AutoFill Destination:=Range("B4:B" & LastRow)
Range("B4:B" & LastRow).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C4").Select
Selection.FormulaArray = _
"=IFERROR(IF(INDEX(allofit,MATCH(1,(Name=RC1)*(SOP=R2C),0),7)=""Acquired"",""X"",IF(INDEX(allofit,MATCH(1,(Name=RC1)*(SOP=R2C),0),7)=""Overdue"",""O"",""--"")),"" "")"
Selection.AutoFill Destination:=Range("C4:C" & LastRow)
Range("C4:C" & LastRow).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("d4").Select
Selection.FormulaArray = _
"=IFERROR(IF(INDEX(allofit,MATCH(1,(Name=RC1)*(SOP=R2C),0),7)=""Acquired"",""X"",IF(INDEX(allofit,MATCH(1,(Name=RC1)*(SOP=R2C),0),7)=""Overdue"",""O"",""--"")),"" "")"
Selection.AutoFill Destination:=Range("d4:d" & LastRow)
Range("d4:d" & LastRow).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
end sub