Excel Vba Array Remove First

[Solved] Excel Vba Array Remove First | Vb - Code Explorer | yomemimo.com
Question : excel vba array remove first

Answered by : vastemonde

Public Sub DeleteElementFromArray(ByRef pArray As Variant, ByVal pIndex As Long) Dim index As Integer If pIndex >= LBound(pArray) And pIndex <= UBound(pArray) Then For index = pIndex + 1 To UBound(pArray) pArray(index - 1) = pArray(index) Next If UBound(pArray) - LBound(pArray) > 0 Then ReDim Preserve pArray(UBound(pArray) - LBound(pArray) - 1) Else ReDim pArray(0) End If End If
End Sub

Source : | Last Update : Mon, 22 Feb 21

Answers related to excel vba array remove first

Code Explorer Popular Question For Vb