Hello everyone,
After simulating particle falls, I would like to sort these particles with the following code:
Sub real vib()
'Sorting Macro
Dim NbParticles As Long
MbParticles ActiveSheet.UsedRange.Rows.Count
"MsgBox NbParticles
'Delete the particles above the 30deg slope
For 1 To NbParticles
If Cells (i, 2) .Value >0.053345 - Sqr(3)/3*Cells(i,1) .Value Then
Rows(1).ClearContents
End If
Next i
[A:A].SpecialCells(xlCellTypeBlanks) EntireRow.Delete
'Change the diameter litle bit to have different color of particle
NbParticles = ActiveSheet.UsedRange.Rows.Count
For i=1 To NbParticles
If (Cells(i, 1).Value < -0.236 + 0.075) Or (Cells (i,1).Value >-0.236+0.15 And Cells (i,1).Value <-0.236 + 0.225)
Or (Cells(i, 1).Value > -0.236 + 0.3)And(Cells(i, 1).Value < 0.0236 + 0.375 Then
Cells (i,4)=0.01
Else
Cells(1, 4) = 0.0101
End If
Next i
Range (Cells(1, 1), Cells (nbLignes, 4)).Copy
MegBox nbLignes
End Sub
Where do I integrate this code and how do I run it so that Mfix sorts the particles after simulating particle falls?
Thanks for your help !