I’m now able to tabulate the % after matching the values from sheet 1 with sheet 2 with the help of Sid. But now, I’m facing this problem,
The following is an image of a problem that i’m facing currently.
In Image1, it is just some test results to be tabulated into %.

After much help, i’m now able to tabulate it but if you notice after Column H, the result continues to tabulate because i have set the settings all the way til Column Z.

I’m required to prepare for tests with more columns that is why i set the set til Column Z. What i’m curious about is, is it possible for me to clear all #DIV/0! when there are no more results?
Thank you once again!
Follow up:
My code is as of below:
Sub Macro3()
Dim ws As Worksheet
Dim wsData As String
Dim SearchText As String, Excludetext As String
Dim LastRow As Long, i As Long, j As Long
Dim MyArray() As String
Dim boolContinue As Boolean
'start making Yield_summary into %
'~~> Add/Remove the text here which you want to ignore
Excludetext = "Split,Grade,Wafer,temp,Qty. In,Qty. Out,Bin1,Bin2,Bin3,Bin4,Bin5,Bin6"
'~~> Change this to the relevant sheetname which has the data
wsData = "Sheet1"
MyArray = Split(Excludetext, ",")
Set ws = Sheets("Sheet2")
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
'Set Column B into %
For i = 1 To LastRow
boolContinue = True
For j = 0 To UBound(MyArray)
SearchText = MyArray(j)
If ws.Range("A" & i).Value = SearchText Then
boolContinue = False
Exit For
End If
Next j
If boolContinue = True Then
With ws.Range("B" & i)
.Formula = _
"=OFFSET(INDIRECT(ADDRESS(INDEX(MATCH(A" & i & _
"," & wsData & "!$A$1:$A$50,0),1,0),1,1,TRUE,""" & _
wsData & """)),0,1)/" & wsData & "!B5"
.NumberFormat = "0.00%"
End With
End If
Next i
'Set Column C into %
For i = 1 To LastRow
boolContinue = True
For j = 0 To UBound(MyArray)
SearchText = MyArray(j)
If ws.Range("A" & i).Value = SearchText Then
boolContinue = False
Exit For
End If
Next j
If boolContinue = True Then
With ws.Range("C" & i)
.Formula = _
"=OFFSET(INDIRECT(ADDRESS(INDEX(MATCH(A" & i & _
"," & wsData & "!$A$1:$A$50,0),1,0),1,1,TRUE,""" & _
wsData & """)),0,2)/" & wsData & "!C5"
.NumberFormat = "0.00%"
End With
End If
Next i
End sub'
I can see from Sid’s answer to your previous question that you are putting a formula in your cells like this:
You can follow up by checking whether the formula returns an error (e.g.
#DIV/0!), and if so, remove the formula, since it isn’t useful: