View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\)[_49_] Rick Rothstein \(MVP - VB\)[_49_] is offline
external usenet poster
 
Posts: 1
Default Script that automatically writes

So it will go a little like this:

1- XL looks at all the data in colum A
2- Data in column A is then compared to that in column B
3- Is there are any difference, missing data is appended to column B


Can you explain what you mean by #3 above? What exactly do you consider
a
"difference"? The data in Column A is not anywhere in Column B? Or it
might
be in Column B, but in a different row? Something else, perhaps?


By difference, I mean if the data is not anywhere to be found in
column B.


In that case, the code Bob posted (corrected by me in a subsequent message)
will do what you want. Here is Bob's corrected code that you can copy/paste
into your own VBA code...

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
With ActiveSheet
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If IsError(Application.Match(.Cells(i, "A").Value, _
.Columns(2), 0)) Then
.Cells(.Range("B1").End(xlDown).Offset(1, 0).Row, "B").Value = _
.Cells(i, "A").Value
End If
Next i
End With
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub

Rick