Hello,
This is my first post and hope this is not a silly question.
Is it possible to create a criteria for an if or case statement dynamically?
For example, if the string variable 'criteria' is literally "Sheet1.Cells.Range(A1).value = "A" AND Sheet1.Cells.Range(B1) <> "B", I would like to put:
Option #1:
actual result: Type mismatch error![]()
If criteria then Sheet1.Rows.EntireRow.Delete End if
desired result: delete row based on criteria passed
Option #2:
use a case statement?
actual result: deletes row regardless of criteria being passed![]()
Select Case criteria Case criteria MsgBox ("deleting...") Sheet1.Rows.EntireRow.Delete Case Else MsgBox ("Row not deleted.") End Select
desired result: delete row based on criteria passed
Thanks in advance.
Bookmarks