Yes, line breaks in if operations are supported.
I ran the following code both in Excel / VBA and as a single vbscript, and it worked without throwing an error.
Dim aStr aStr = "yeah" If (UCase(Trim(aStr)) = "YES") Or _ (UCase(Trim(aStr)) = "NO") Then MsgBox "yes/no" Else MsgBox "no action" End If
Or is it a problem with objSheet? Have you tried setting a variable for UCase(Trim(objSheet.Cells(i, a).Value) ? Did the expected value UCase(Trim(objSheet.Cells(i, a).Value) ?
marcw source share