David Hawley (Compare-copy, From: Andonny
Posted by Joe Was on May 03, 2001 7:38 AM
Your help to Andonny looks like it could be of help to me as well, but I am having a problem adding a couple of twists to your code.
I would like your code to run from a Button and to take data from one (single project) workbook sheet and put it in a different workbook (data from all projects).
I am not as skilled as you are and am having trouble with the workbook reference and the "Range" works with a "Ctrl+ Macro" but fails in the Button code?
Any ideas?
Dim rCell As Range
Dim LookRange As Range
Application.ScreenUpdating = False
ActiveWorkbook.ChangeLink "H:\users\rw155jw\excel\Appraisal_Fees_Ver2_test.xls", "H:\users\rw155jw\excel\Appraisal_Fees_Search_File_test2.xls", xlLinkTypeExcelLinks
Set LookRange = Range("A6", Range("AB65536").End(xlUp))
For Each rCell In LookRange
If WorksheetFunction.CountIf _
(Sheets("Sheet3").Columns(1), rCell.Text) = 0 Then
rCell.Range("A6:AB6").Copy _
Destination:=Sheets("Sheet1").Range("A65536").End(xlUp).Offset(1, 0)
End If
Next rCell
Application.CutCopyMode = False
Application.ScreenUpdating = True