title: Excel VBA - Log changes when old value of a cell is changed manually in Excel
body: <p>I want to add detailed log with changes to the sheet "Audit" when a cell value is changed in Sheet 1. However no changes should be logged when value is entered in a blank cell. I am working on the below code , but unable to remove blank cell change logs.</p>
  
  <pre><code>Option Explicit
  
  
  Const LiveWS As String = "Sheet1"
  Const AuditWS As String = "Audit"
  
  Private Sub Workbook_Open()
  
    Dim iRow As Integer
    Dim iCol As Integer
    Dim iLastRow As Long
  
    For iRow = 9 To 20
      For iCol = 4 To 22
        If Sheets(AuditWS).Cells(iRow, iCol).Value &lt;&gt; Sheets(LiveWS).Cells(iRow, iCol).Value Then
          iLastRow = Sheets(AuditWS).Cells(Rows.Count, 1).End(xlUp).Row
          Sheets(AuditWS).Cells(iLastRow + 1, 1) = "Cell(" &amp; CStr(iRow) &amp; "," &amp; CStr(iCol) &amp; ") " _
            &amp; "changed from '" &amp; Sheets(AuditWS).Cells(iRow, iCol).Value &amp; "' " _
            &amp; "to '" &amp; Sheets(LiveWS).Cells(iRow, iCol).Value &amp; "'"
          Sheets(AuditWS).Cells(iRow, iCol) = Sheets(LiveWS).Cells(iRow, iCol).Value
        End If
      Next iCol
    Next iRow
  
    iLastRow = Sheets(AuditWS).Cells(Rows.Count, 1).End(xlUp).Row
    Sheets(AuditWS).Cells(iLastRow + 1, 1) = "Workbook opened by " &amp; Environ("USERNAME") _
       &amp; " on " &amp; Format(Now(), "dd/mm/yyyy") &amp; " at " &amp; Format(Now(), "hh:nn:ss")
  
    ActiveWorkbook.Save
  
  End Sub
  </code></pre>