Sub test()
Dim i, j, n, quant, price, arr(1 To 10000, 1 To 3)
lrow = [a65536].End(xlUp).Row
For i = 1 To lrow - 1
quant = Split(Cells(i + 1, 1).Value, Chr(10))
price = Split(Cells(i + 1, 2).Value, Chr(10))
For j = 0 To UBound(quant)
If Right(quant(j), 1) Like "g" And VBA.IsNumeric(Right(price(j), 1)) Then
n = n + 1
arr(n, 1) = quant(j)
arr(n, 2) = "'" & price(j)
arr(n, 3) = Cells(i + 1, 3)
End If
Next j
Next i
With Sheets.Add
.[a1:c1] = Array("quantity", "price", "supplier name")
.[a2].Resize(n, 3) = arr
End With
End Sub
Sub tt()
For i = 1 To Len([a2])
xx = Mid([a2], i, 1)
Debug.Print xx & "|" & VBA.Asc(xx)
Next i
End SubI
Dim i, j, n, quant, price, arr(1 To 10000, 1 To 3)
lrow = [a65536].End(xlUp).Row
For i = 1 To lrow - 1
quant = Split(Cells(i + 1, 1).Value, Chr(10))
price = Split(Cells(i + 1, 2).Value, Chr(10))
For j = 0 To UBound(quant)
If Right(quant(j), 1) Like "g" And VBA.IsNumeric(Right(price(j), 1)) Then
n = n + 1
arr(n, 1) = quant(j)
arr(n, 2) = "'" & price(j)
arr(n, 3) = Cells(i + 1, 3)
End If
Next j
Next i
With Sheets.Add
.[a1:c1] = Array("quantity", "price", "supplier name")
.[a2].Resize(n, 3) = arr
End With
End Sub
Sub tt()
For i = 1 To Len([a2])
xx = Mid([a2], i, 1)
Debug.Print xx & "|" & VBA.Asc(xx)
Next i
End SubI