Hal9va
12-01-2010, 05:43 PM
Hi,
I have a piece of code that I want to change but I do not know the right syntaxes. I have searched the web and could not find it.
If rw1Row > rw2Row _
Then
Set Rng1 = Range("A" & rFDRow) 'Setting a Range 1
Rng1.FormulaR1C1 = "=IF(old!RC<>new!RC, ""Don't Match"", old!RC)"
Rng1.Copy Destination:=Rng1.Resize(rw1Row - 3, 19)
Rng1.Copy Destination:=Range("AB" & rFDRow).Resize(rw1Row - 3, 4)
New and Old are the names of the two worksheets. Theses worksheets are presented in the certain order/sequence. (New is worksheet 1, Old is worksheet 2). I want this code to implement the formula without using the names of the worksheets. Just referring to the sheets.
"=IF(" & Sheets(1).Name & "!RC <>" & Sheets(2).Name & "!RC," "Don't Match," & Sheets(1).Name & "!RC")"
I tried this combination and other, but still does not work.
Thanks a lot
I have a piece of code that I want to change but I do not know the right syntaxes. I have searched the web and could not find it.
If rw1Row > rw2Row _
Then
Set Rng1 = Range("A" & rFDRow) 'Setting a Range 1
Rng1.FormulaR1C1 = "=IF(old!RC<>new!RC, ""Don't Match"", old!RC)"
Rng1.Copy Destination:=Rng1.Resize(rw1Row - 3, 19)
Rng1.Copy Destination:=Range("AB" & rFDRow).Resize(rw1Row - 3, 4)
New and Old are the names of the two worksheets. Theses worksheets are presented in the certain order/sequence. (New is worksheet 1, Old is worksheet 2). I want this code to implement the formula without using the names of the worksheets. Just referring to the sheets.
"=IF(" & Sheets(1).Name & "!RC <>" & Sheets(2).Name & "!RC," "Don't Match," & Sheets(1).Name & "!RC")"
I tried this combination and other, but still does not work.
Thanks a lot