Sub testvalue()
If Selection.Value >= 5 Then
If Selection.Value <= 10 Then
Selection.Offset(1, 0).Value = 25 'this is where you can put your code
End If
End If
End Sub
there are dozens of of sites that explain VBA,
here is a great one to start printing off and start reading
Your number less than the minimum of No1, No2
Your number is equal to the minimum of No1, No2
Your numer is between No1 & No2
Your number is equal to the maximum of No1, No2
Your number greater than the maximum of No1, No2
The example test whether a number is between 50 and 100. It first assigns the
value to be tested to a variable "a". In the example, the value of the
selected cell is being tested.
Sub test()
Dim a
a = Selection.Value
If a > 50 And a < 100 Then
MsgBox "Hello"
End If
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.