Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro which tells Excel to run through a list of cells
and print a worksheet if the content of the cell satisfies two conditions. The first one is that the content of the cell should match the content of a cell named "Restrict". This works. The other condition is that the cell should not contain a question mark. I can't get this to work. The macro works fine if I let it look for a "?" and then print if it finds one - but I want the opposite, cells with "?" in them should be ignored. This is the code that works: If Left(ActiveCell, Len(Range("Restrict"))) = Range("Restrict") _ Then If InStr(1, ActiveCell, "?") Then [Code for print-out] End If End If I've tried to amend the second line like this: If Not(InStr(1, ActiveCell, "?")) Then and If InStr(1, ActiveCell, "?") = 0 Then but when I try to run the macro, Excel freezes up before finishing. What am I doing wrong here?? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Crashes when typing "False" in VLookup formula | Excel Worksheet Functions | |||
Excel crashes when typing "false" in VLookup function | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Excel crashes on "Close" Visual Basic error 400 | Excel Discussion (Misc queries) | |||
Excel 2000 crashes after "touching" a userform with the mouse and closing it | Excel Programming |