madkinson
Board Regular
- Joined
- Dec 17, 2004
- Messages
- 113
- Office Version
- 365
- Platform
- Windows
I have a portion of a SELECT Case statement that I want to fire based on whether there is a value in the cell or whether it is blank (see HIGHLIGHTED):
The inside parts work as intended, but I can't get the second Select Case to fire on the first option (where Case = " "). I guessed that it doesn't recognize a " " as a blank, so I tried reversing the logic so the first option was (where Case Like "*"). It didn't like that either, so I really don't know how to proceed from here.
Thanking you in advance,
Mark
Code:
Select Case Range("T" & ActiveCell.Row) ' Action
Case "Removed"
[B] [U]Select Case Range("R" & ActiveCell.Row) ' Rule or blank[/U][/B]
Case " "
Select Case Range("D" & ActiveCell.Row) ' Control Flag
Case "Yes"
Select Case Range("U" & ActiveCell.Row) ' Permanent
Case "Yes"
ActiveCell.Value = "Permanently removed the Control Flag from account " & Range("J" & ActiveCell.Row) & "." & Chr(10) & "Removed " & Range("V" & ActiveCell.Row) & "."
Case Else
ActiveCell.Value = "Removed the Control Flag from account " & Range("J" & ActiveCell.Row) & "." & Chr(10) & "Removed " & Range("V" & ActiveCell.Row) & " and restored " & Range("W" & ActiveCell.Row) & "."
End Select
Case Else
Select Case Range("U" & ActiveCell.Row) ' Permanent
Case "Yes"
ActiveCell.Value = "Permanently removed account " & Range("J" & ActiveCell.Row) & " on the " & Range("Q" & ActiveCell.Row) & " node of the " & Range("P" & ActiveCell.Row) & " tree." & Chr(10) & "Removed " & Range("V" & ActiveCell.Row) & "."
Case Else
ActiveCell.Value = "Removed account " & Range("J" & ActiveCell.Row) & " from the " & Range("Q" & ActiveCell.Row) & " node of the " & Range("P" & ActiveCell.Row) & " tree." & Chr(10) & "Removed " & Range("V" & ActiveCell.Row) & " and restored " & Range("W" & ActiveCell.Row) & "."
End Select
End Select
Case Else
Select Case Range("U" & ActiveCell.Row) ' Permanent
Case "Yes"
ActiveCell.Value = "Permanently removed account " & Range("J" & ActiveCell.Row) & " from the " & Range("R" & ActiveCell.Row) & " rule." & Chr(10) & "Removed " & Range("V" & ActiveCell.Row) & "."
Case Else
ActiveCell.Value = "Removed account " & Range("J" & ActiveCell.Row) & " from the " & Range("R" & ActiveCell.Row) & " rule." & Chr(10) & "Removed " & Range("V" & ActiveCell.Row) & " and restored " & Range("W" & ActiveCell.Row) & "."
End Select
End Select
End Select
The inside parts work as intended, but I can't get the second Select Case to fire on the first option (where Case = " "). I guessed that it doesn't recognize a " " as a blank, so I tried reversing the logic so the first option was (where Case Like "*"). It didn't like that either, so I really don't know how to proceed from here.
Thanking you in advance,
Mark