Is Entire Variant Full VBA Check

  • Hi,

    I have an array(1 to 5) variant type variable and am trying to create a macro that will check to see if all spots within the variant array are filled or not. Is there a way that I can accomplish this with a simple if statement like:

    if there are no empty spots in array(1 to 5) then

    'do some code here

    End If

    without having to loop through the array every time to check it? Is the only way to accomplish this using something like:

    If Not IsNull(array(1)) And Not IsNull(array(2)) And Not IsNull(array(3)) And Not IsNull(array(4)) And Not IsNull(array(5)) Then

    'do some code here

    End If

  • you could define another variable, as you fill the array increment the other variable

    check that variable, if its at 5 then the array is full

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!