If a cell is not blank
Macro Title:
|
Worksheet Variable:
|
Worksheet Name:
|
Test Cell Reference:
enter the cell that you want to test |
Output Cell:
|
Value if test is True:
enter the value that you want returned if a cell is not blank |
Value if test is False:
enter the value that you want returned if a cell is blank |
First Comment:
' |
Second Comment:
' |
Sub If_a_cell_is_not_blank_using_vbNullString()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'calculate if a cell is not blank
If ws.Range("C5") <> vbNullString Then
ws.Range("D5") = "Yes"
Else
ws.Range("D5") = "No"
End If
End Sub
Sub If_a_cell_is_not_blank_using_vbNullString()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'calculate if a cell is not blank
If ws.Range("C5") <> vbNullString Then
If ws.Range("C5") <> vbNullString Then
ws.Range("D5") = "Yes"
Else
ws.Range("D5") = "No"
End If
End Sub