返回列表 上一主題 發帖

合併程式問題

合併程式問題

各位前輩  如下程式應如何合併才可執行  謝謝!
    Sub Worksheet_change(ByVal T As Range)
  A程式  
  If T.Address <> "$Q$5" Then Exit Sub
       If ActiveSheet.Range("$q$5").Cells = "kk" Then
          Run "NewB"
       ElseIf ActiveSheet.Range("$q$5").Cells = "ka" Then
          Run "NewB"
     Else
     End If

  B程式
    If T.Address <> "$F$15" Then Exit Sub
       If ActiveSheet.Range("$F$15").Cells <> ActiveSheet.Range("$F$14").Cells Then
          Run "PP1"
     End If

回復 2# stillfish00
stillfish00對不起
應該是
     If ActiveSheet.Range("$q$5").Cells = "kk" Then
          Run "NewA"
       ElseIf ActiveSheet.Range("$q$5").Cells = "ka" Then
          Run "NewB"
程式是否可以這樣寫  請指正
  If Target.Value="kk" then
     Run "NewA
ElseIf Target.Value="ka" then
  run "NewB"
else

End if

TOP

回復 4# luhpro
luhpro thanks

TOP

        靜思自在 : 忘功不忘過,忘怨不忘恩。
返回列表 上一主題