If a cell is greater than or equal to a specific value
Macro Title:
|
Worksheet Variable:
|
Row Reference Variable:
|
Worksheet Name:
|
Cell Reference of Specific Value:
enter the cell reference that captures the value that you want to test other cells against for being greater than or equal to this value |
Test From Row Number:
enter the first row number of a cell from which you want to begin testing |
Test To Row Number:
enter the last row number of a cell which you want to test |
Test Column Number:
enter the column number of the column that captures the cells that you want to test |
Output Column Number:
enter the column number of the column in which you want to return the results |
Value if test is True:
enter the value that you want returned if a cell is greater than or equal to a specified value |
Value if test is False:
enter the value that you want returned if a cell is less than a specified value |
First Comment:
' |
Second Comment:
' |
Sub If_a_cell_is_greater_than_or_equal_to_a_specific_value_using_For_Loop()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'calculate if a cell is greater than or equal to a specific value with a For Loop
For x = 8 To 14
If ws.Cells(x, 3) >= ws.Range("C5") Then
ws.Cells(x, 4) = "No"
Else
ws.Cells(x, 4) = "Yes"
End If
Next x
End Sub
Sub If_a_cell_is_greater_than_or_equal_to_a_specific_value_using_For_Loop()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'calculate if a cell is greater than or equal to a specific value with a For Loop
For x = 8 To 14
For x = 8 To 14
If ws.Cells(x, 3) >= ws.Range("C5") Then
ws.Cells(x, 4) = "No"
Else
ws.Cells(x, 4) = "Yes"
End If
Next x
End Sub