Trying to add in control names from a userform into an array to be spat out into a msgbox at the end. arrBlank Fields is supposed to look at controls and see if they're blank or not. if they are, redim preserve each name and then keep looping through to find all blank fields.
Dim icontrol As Control
Dim arrBlankFields As Variant
Dim i As Long, x As Long
'for loop
Case icontrol.Name Like "txt*"
If icontrol.Value = "" Then
ReDim Preserve arrBlankFields(1 To UBound(arrBlankFields))
arrBlankFields(x) = icontrol.Name
x = x + 1
End If
'end loop
getting a type mismatch at 1 to UBound(arrBlankFields). I've also tried just doing ReDim Preserve arrBlankFields(x) because it's just a 1-dimensional array, but no luck.
Any ideas?
Redim arrBlankFields(1 to 1) As Variant- Scott CranerarrBlankFields(x)part ofarrBlankFields(x) = icontrol.Name- NidenKx=1prior to the loop also. - Scott Craner0like a normal programmer. - HackSlash