AbdulkareemAlhassni
New Member
- Joined
- Nov 16, 2018
- Messages
- 41
Hello,
I have been having trouble with this code for more than a week, i have tried to find a solution but i could not
The problem is the Code keeps only inputting A1 value in the excel sheet.
THE REPLACE DOES NOT WORK, I DONT KNOW WHY
I have been having trouble with this code for more than a week, i have tried to find a solution but i could not
Code:
'THE BELOW IS MY DESIRED MAGIC
LastRow = Range("A1").End(xlDown).Row
Range("A1").Activate
n = ActiveCell.EntireRow.Find("Requisition", LookAt:=xlWhole).Column
Cells(1, n).Select
ActiveCell.Offset(1, 0).Select
'With Range(ActiveCell, ActiveCell.Offset(numRows, numCols))
With Range(ActiveCell, ActiveCell.Offset(numRows, numCols))
.FormulaArray = "=IF(A1="""","""",A1)"
.Replace "A1", "INDEX('PO Dist'!$W$2:'PO Dist'!$W$100000,MATCH(1,(A2='PO Dist'!$A$2:$A$100000)*(B2='PO Dist'!$B$2:$B$100000),0))"
End With
ActiveCell.AutoFill Range(ActiveCell.Address, Cells(LastRow, ActiveCell.Column))
The problem is the Code keeps only inputting A1 value in the excel sheet.
THE REPLACE DOES NOT WORK, I DONT KNOW WHY