Basically I am trying to Loop through all the values in the array and count the number of values that are greater than a value specified by the user by using Inputbox and also trying to use the IF statement to ensure a number between 1 and 100 is entered. After that is done I just want to simply display the results in a message box after.
Here is what I have so far:
Dim arr As Variant
arr = Range("A1:J10")
Range("A1").Resize(UBound(arr, 1), UBound(arr, 2)) = arr
Dim val As String
val = InputBox("Enter an integer value")
If val < 1 Or val > 100 Then
' tells the user to try again
MsgBox "You did not enter a value from 1 to 100 , try again"
val = Inputbox("Enter an integer value")
Else
End If
Basically struggling with the if statement to verify the contents entered by the user and looping through the array.
orin the if statement asvalcannot be both less than one and greater than 100.