Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I initially wanted to be able to truncate an array as needed by the
code. An answer along with the initial code was found in a GoogleGroup. When though an array that has stored numeric values is truncated, the nature of the data stored is changed. For example, the values of the array prior to truncation would be plain numbers e.g. 1, 2, 3 etc whereas after running the truncation section, the remaining values change into "1", "2", "3", etc. I have attempted to convert to an Integer value but as shown below, it was ineffective. Comparisons of data derived from the array with distinctly defined numbers numbers are possible. Comparisons with variables to which values have been pre-assigned are unfortunately not possible. As this does not allow any further array manipulation & valid data extraction, I have reached a standstill and would appreciate any suggestions anyone would have to offer. Many thanks Kostas PS. VBA code example of array truncation as follows : Sub Array_truncation() vv = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) var1 = 2 Debug.Print "" Debug.Print "New Run" For Each x In vv Debug.Print x Next x If vv(2) = var1 Then Debug.Print "2=2 ok" Else Debug.Print "problem at stage 1" Debug.Print (2) Dim Unique Unique = Chr(255) ' This example is "Zero" based, so index is 4 & 8 vv(4) = Unique 'Now, delete them... vv = Filter(vv, Unique, False) Debug.Print "" For Each x In vv Debug.Print x Next x If vv(2) = var1 Then Debug.Print "2=2 ok" Else Debug.Print "problem at stage 2" vv(4) = Unique 'Now, delete them... vv = Filter(vv, Unique, False) Debug.Print "" Dim x2 As Integer For Each x In vv x = x2 Debug.Print x Next x If vv(2) = var1 Then Debug.Print "2=2 ok" Else Debug.Print "problem at stage 3" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
removing a cell from an array | Excel Discussion (Misc queries) | |||
Removing Data Tables formed from importing data from Access | Excel Discussion (Misc queries) | |||
Global array data got erased after removing reference in VBA | Excel Programming | |||
removing blank entries from an array | Excel Programming | |||
Scanning for Duplicate Data in a Column, Merging Data and Finally Removing All Duplicates...? | Excel Programming |