Which VBA code is better
I trust the respective methods are not intended to refer to the same pair of
cells !
Regards,
Peter T
"Andy" wrote in message
...
Hi,
I have the following codes and would like to know which one is more
effective and the difference.
Sub Test1()
Dim myRow As Single
Range("A1") = Range("ItemTitle").Offset(myRow)
Range("B1") = Range("QtyTitle").Offset(myRow)
End Sub
Sub Test2()
Dim myRow As Single
Range("A1") = Cells(myRow, Range("ItemTitle").Column)
Range("B1") = Cells(myRow, Range("QtyTitle").Column)
End Sub
I like Test1 more as it is easier to write and seems to me that Test2 may
need a worksheet qualifier if it's referencing another worksheet.
Thanks
Andy, HK
|