Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Add values in an Array to compare

  1. #1


    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

    Now I want to compare each Start # and End # with my Start # and End #. Any Help would be fabulous!

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)


    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.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts