Is the . in .Range necessary when defined by .Cells?

前端 未结 3 964
终归单人心
终归单人心 2020-11-22 03:24

It is pretty much widely accepted that this is not \'best practise\'.

dim rng as range
with thisworkbook    \'<~~ possibly set an external workbook 
    w         


        
3条回答
  •  天涯浪人
    2020-11-22 04:06

    No, the . is not required where the cell references inside the brackets are qualified, unless the code is in a Worksheet module. That said it is faster to run set rng = .range(.cells(...), .cells(...)) than it is to run set rng = range(.cells(...), .cells(...)) so including the . does some good.

    For a Worksheet module, the . is required.

提交回复
热议问题