Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Which VBA code is better
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
Excel code convert to Access code - Concat & eliminate duplicates | Excel Programming |