For example, the following statement enlarges the array by 10 elements without losing the current values of the original elements. VB ReDimPreservevarArray(UBound(varArray) +10) Note When you use thePreservekey
Function GetFileNames(ByVal FolderPath As String) As Variant Dim Result As Variant Dim i As Integer Dim MyFile As Object Dim MyFSO As Object Dim MyFolder As Object Dim MyFiles As Object Set MyFSO = CreateObject("Scripting.FileSystemObject") Set MyFolder = MyFSO.GetFolder(FolderPath) Set ...
However, each time you do this, the existing values in the array are lost. Use ReDim Preserve to expand an array while preserving existing values in the array.For example, the following statement enlarges the array by 10 elements without losing the current values of the original elements....
However, each time you do this, the existing values in the array are lost. Use ReDim Preserve to expand an array while preserving existing values in the array. For example, the following statement enlarges the array by 10 elements without losing the current values of the original elements. ...
Use ReDim Preserve to expand an array while preserving existing values in the array.For example, the following statement enlarges the array by 10 elements without losing the current values of the original elements.vb Kopiëren ReDim Preserve varArray(UBound(varArray) + 10) ...