J
john-lau
Hello
I get the macro from GS, it is about compare "account number" colum
(column K) in two workbooks, if it is matched account number, column L to
dat
will be copy from week1 unknown sor to week2 unknown sor.xls). May I ask ho
t
modify the macro, therefore, not all matched account number, copy data o
colum
L to N from week 1 excel to week 2 excel? For example, selection criteria i
column k ( column k, it has several choice: week 1 , week 2, week 3...
The code and file as following
https://rapidshare.com/files/461244589/week1_unknown_SOR_May.xl
https://rapidshare.com/files/461244592/week2_unknown_sor_May.xl
Sub CompareData_CustomerNewUpgrades(
Dim rngSource As Range, rngTarget As Range, rng As Rang
Dim lLastRow As Long, lRow As Long, i As Intege
Set rngTarget = Workbooks("week2 unknow
SOR.xls").Sheets("Unknown Customer Ne
Upgrade").Range("$l:$l"
Set rngSource = ThisWorkbook.Sheets("Unknown Customer Ne
Upgrade").Range("$l:$l"
lLastRow = rngSource.Rows(rngSource.Rows.Count).End(xlUp).Ro
For lRow = 1 To lLastRo
Set rng = rngTarget.Find(What:=rngSource.Cells(lRow), LookAt:=xlWhole
If Not rng Is Nothing The
For i = 1 To 2: rng.Offset(, i) = rngSource.Cells(lRow).Offset(, i): Nex
End I
Nex
End Sub 'CompareData_CustomerNewUpgrades(
Thanks
I get the macro from GS, it is about compare "account number" colum
(column K) in two workbooks, if it is matched account number, column L to
dat
will be copy from week1 unknown sor to week2 unknown sor.xls). May I ask ho
t
modify the macro, therefore, not all matched account number, copy data o
colum
L to N from week 1 excel to week 2 excel? For example, selection criteria i
column k ( column k, it has several choice: week 1 , week 2, week 3...
The code and file as following
https://rapidshare.com/files/461244589/week1_unknown_SOR_May.xl
https://rapidshare.com/files/461244592/week2_unknown_sor_May.xl
Sub CompareData_CustomerNewUpgrades(
Dim rngSource As Range, rngTarget As Range, rng As Rang
Dim lLastRow As Long, lRow As Long, i As Intege
Set rngTarget = Workbooks("week2 unknow
SOR.xls").Sheets("Unknown Customer Ne
Upgrade").Range("$l:$l"
Set rngSource = ThisWorkbook.Sheets("Unknown Customer Ne
Upgrade").Range("$l:$l"
lLastRow = rngSource.Rows(rngSource.Rows.Count).End(xlUp).Ro
For lRow = 1 To lLastRo
Set rng = rngTarget.Find(What:=rngSource.Cells(lRow), LookAt:=xlWhole
If Not rng Is Nothing The
For i = 1 To 2: rng.Offset(, i) = rngSource.Cells(lRow).Offset(, i): Nex
End I
Nex
End Sub 'CompareData_CustomerNewUpgrades(
Thanks