Select and Activate
Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Select and Activate

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Singapore
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Could you tell me what's the difference between Select and Activate by Example? The object maybe Worksheet, Windows, or Workbook.

  2. #2
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,136
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I took a look at Michael Kofler's book "Definitive Guide to Excel VBA" regarding this.

    Not a whole lot of difference. Both methods are used without parameters and do not return a direct result. They change properties such as ActiveCell and Selection.

    Activate is generally intended for individual cells, and Select for ranges of cells (these methods also are used with other objects, such as worksheets, charts, etc, but my response here is to speak in general terms).

    Whether you Select range A1:A5, or Activate A1:A5, A1 will be the active cell, and A1:A5 the selected range.

    The only other thing (which really speaks to their same-ness instead of difference) is that both methods can only select cells or ranges in the active worksheet. If you are on Sheet1 and try something like Range(Sheet2!A1).Select, you'd get an error.

    Bottom line, not a heckuva lotta diff, especially where cells and ranges are concerned.

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Singapore
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thx.Tom, so to summarize, the key difference is in Range Object.
    I don't know whether the effects will be different using Sheets("Sheet1").Activate or Sheets("Sheet1").Select. Maybe in later work, the doubts will be cleared by errors.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com