![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
I have to compare the values of an array with a another value. How do you add items to an array using VBA Code? For example:
Col A = Start # Col B = End # Cell A1 = 100, B1 = 200 Nothing in Row 2 Cell A3 = 300, B3 = 400 Cell A4 = 500, B4 = 600 etc.... Now I want to compare each Start # and End # with my Start # and End #. Any Help would be fabulous! |
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Brampton
Posts: 324
|
Declare two dynamic arrays for the two columns, which could be resized periodically with Redim Preserve:
Dim MyArray() As Integer Redim Preserve MyArray(100) You could have used a two-dimension array but you cannot redim the array with preserve because only one array is going to preserve previous declared values. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|