ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

VBE­×§ï

VBE­×§ï

¤U­±µ{¦¡¬°Àˬd¬O§_¦³¦b A2 ©Î A3 Àx¦s®æ¿é¤J¤Fµª®×
­YA2~A201­n¦³¤U­±ªº¤è¦¡,­n¦p¦ó­×§ïVBA?

Private Sub Worksheet_Change(ByVal Target As Range)
Dim answerCell As Range
Dim correctnessCell As Range
Dim correctCount As Integer
Dim wrongCount As Integer

Set answerCell = Range("A2")
Set correctnessCell = Range("F2")
correctCount = Range("H2").Value
wrongCount = Range("I2").Value

' Àˬd¬O§_¦³¦b A2 ©Î A3 Àx¦s®æ¿é¤J¤Fµª®×
If Not Intersect(Target, answerCell) Is Nothing Then
    ' Àˬd¹ïÀ³ªº§PÂ_Àx¦s®æ¬O§_¬° "TRUE" (¥¿½T)
    If UCase(correctnessCell.Value) = "TRUE" Then
        ' ¥¿½T¦¸¼Æ²Ö¥[
        correctCount = correctCount + 1
        Range("H2").Value = correctCount
    ElseIf UCase(correctnessCell.Value) = "FALSE" Then
        ' ¿ù»~¦¸¼Æ²Ö¥[
        wrongCount = wrongCount + 1
        Range("I2").Value = wrongCount
    End If
ElseIf Not Intersect(Target, Range("A3")) Is Nothing Then
    ' Àˬd¹ïÀ³ªº§PÂ_Àx¦s®æ¬O§_¬° "TRUE" (¥¿½T)
    If UCase(Range("F3").Value) = "TRUE" Then
        ' ¥¿½T¦¸¼Æ²Ö¥[
        correctCount = Range("H3").Value + 1
        Range("H3").Value = correctCount
    ElseIf UCase(Range("F3").Value) = "FALSE" Then
        ' ¿ù»~¦¸¼Æ²Ö¥[
        wrongCount = Range("I3").Value + 1
        Range("I3").Value = wrongCount
    End If
End If

¦^´_ 1# sillykin


Private Sub Worksheet_Change(ByVal Target As Range)
With Target
   If .Columns.Count > 1 Then Exit Sub
   If .Count > 1 Then Exit Sub
   If Intersect([A2:A200], .Cells) Is Nothing Then Exit Sub
   If UCase(.Item(1, 6)) = "TRUE" Then
      .Item(1, 8) = .Item(1, 8) + 1
      ElseIf UCase(.Item(1, 6)) = "FALSE" Then
      .Item(1, 9) = .Item(1, 9) + 1
   End If
End With
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

ÁÂÁ§Aªº¨ó§U

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD