2016-07-14 5 views
-2

私はVBAマクロが初めてです。プロジェクトを送信するための手順のリストがあり、各ステップに隣接するセルにチェックボックスがあります。チェックボックスをオフのままにしておくと値を表示したい。私はコードを書いていません。私はこれに新しいです。助けが必要。チェックボックスをオフにした場合、隣接セル値の値を表示する方法は?

はい、メッセージボックスを使用して、スナップショットに示されているように送信ボタンをクリックした後にセルの値を非表示にします。

私はこのモジュールを書いたが、その長さは長い。

Sub AllChecked() 

    If Range("d3").Value = 18 Then 
     MsgBox "Project ready for upload" 
    End If 
    If Range("c3").Value = False Then 
     MsgBox "Please review the cover sheet" 
    End If 
    If Range("c4").Value = False Then 
     MsgBox "Please review the processor's notes" 
    End If 
    If Range("c5").Value = False Then 
     MsgBox "Please Review the project map" 
    End If 
    If Range("c6").Value = False Then 
     MsgBox "Please Check the orientation" 
    End If 
    If Range("c7").Value = False Then 
     MsgBox "Please Check for missing data" 
    End If 
    If Range("c8").Value = False Then 
     MsgBox "Please Check for illegal movements" 
    End If 
    If Range("c9").Value = False Then 
     MsgBox "Analyze the data in 2 to 3-hour increments as well as 15-minute increments" 
    End If 
    If Range("c10").Value = False Then 
     MsgBox "Please check the date of collection" 
    End If 
    If Range("c11").Value = False Then 
     MsgBox "Please Check for abnormal peaks or valleys in the datasets" 
    End If 
    If Range("c12").Value = False Then 
     MsgBox "Please give spot checks if necessary" 
    End If 
    If Range("c13").Value = False Then 
     MsgBox "Make small adjustments if necessary" 
    End If 
    If Range("c14").Value = False Then 
     MsgBox "Please checking historical data if it exists" 
    End If 
    If Range("c15").Value = False Then 
     MsgBox "Please Check for the diffrent templets as per the project series" 
    End If 
    If Range("c16").Value = False Then 
     MsgBox "Please Make note for extra leg (include/exclude)" 
    End If 
    If Range("c17").Value = False Then 
     MsgBox "Before removing the side walk from peds count check the rotation and coversheet if client required or not" 
    End If 
    If Range("c18").Value = False Then 
     MsgBox "Sketches? (Always for the 3000 jobs,some with requested Project)(review the processer sketches)" 
    End If 
    If Range("c19").Value = False Then 
     MsgBox "Check for data patterns in the datasets for two successive intervals having same total volume and each movement has similarities etc" 
    End If 
    If Range("c20").Value = False Then 
     MsgBox "Check for data patterns in the datasets for two successive intervals having same total volume and each movement has similarities etc" 
    End If 

End Sub 
+1

どこにメッセージが表示されますか? –

+0

私たちはあなたがこれを動作させようとしたコードを投稿すれば、さらに多くのお手伝いをすることができます。それ以外の場合は非常に曖昧です。 –

+0

どこにメッセージを表示したいですか? (つまり、msboxを使用したいですか?メッセージを表示するためにトリガーとして使用するイベントは何ですか?) –

答えて

1

Range("C3:C20")をループして値をテストし、メッセージを作成できます。この方法では、1つのMsgboxしか持てません。

Sub AllChecked() 

    Dim msg As String 
    Dim c As Range 
    If Range("d3").Value = 18 Then 
     MsgBox "Project ready for upload" 

    Else 
     For Each c In Range("C3:C20") 
      If c.Value = FASLE Then msg = msg & c.Offset(0, -1).Value & vbCrLf 
     Next 
     MsgBox msg, vbInformation, "Fill in these fields before continuing" 
    End If 


End Sub 
+0

Thomas Inzinaありがとうございました。 – aspan88

関連する問題