If Dir("C:\Documents and Settings\aaa\桌面") = "" Then ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\aaa\桌面\1.XLS" End If Else ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\bbb\桌面\1.XLS" End If End sub
不太了解您的所需. 不過 If Dir("C:\Documents and Settings\aaa\桌面") = "" Then ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\aaa\桌面\1.XLS" End If '這行須刪除 Else ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\bbb\桌面\1.XLS" End If End sub 就 If...Then ... Else ... End If 而言
If Worksheets(1).Range("d5").Cells <> 3 Then MsgBox "取消 ?", vbInformation Exit sub If Dir("C:\Documents and Settings\aaa\桌面") = "" Then ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\aaa\桌面\1.XLS" Else ActiveWorkbook.SaveCopyAs "C:\Documents and Settings\bbb\桌面\1.XLS" End If End sub