这样试试:
If([%选择值%] <> "",AddCol("打证数据","筛选",3,0) And EvalFor("打证数据","筛选", -1,"姓名", "=" ,[%选择值%]) And ReplaceFor("打证数据","标识",-1,"筛选", "=" ,0) And FilterFor("筛选", "=" ,-1) And SetVariable("%停止%",0) And ReplaceFor(GridName,"标识",0) And Move(1,1) And SetVariable("%总行数%",VisibleRows) And Loop("2 > 1","Eval([%打印公式1%]) And Move(Row + 1,1)",VisibleRows) And DeleteCol("打证数据","筛选") And Do(112),MsgBox("你尚未选择要打印的姓名,请选择!",1,4))