![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
Could you tell me what's the difference between Select and Activate by Example? The object maybe Worksheet, Windows, or Workbook.
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,388
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|