title: Simplification - changing 2 cells at once
body: <p>I am trying to figure out how to simplify the code with no luck.</p>
  
  <p>I managed to build a working code, which does the following:
  1. If 'ja' is filled into cell 34
  - in cell 35 the date appears
  - in cell 36 the username appears
  2. If the cell is empty, the content is cleared</p>
  
  <p>Do you have any tips / can help me out?</p>
  
  <p>Thank you very much.</p>
  
  <p>This is the code I have so far: </p>
  
  <pre><code>'show date
     If Target.Column = 34 Then
        Select Case Target
           Case "ja", "Ja":    Target.Offset(0, 1) = Date
        End Select
  'show username
     If Target.Column = 34 Then
        Select Case Target
           Case "ja", "Ja":    Target.Offset(0, 2) = Application.UserName
        End Select
  End If
  End If
  
  ' clear contents
      Dim n As Long
  
      If Target.Column = 34 Then
          If IsEmpty(Cells(Target.Row, 34)) Then
                 Range("AI" &amp; Target.Row &amp; ":AJ" &amp; Target.Row).ClearContents
          End If
      End If
  End Sub
  </code></pre>