Basically, many objects can be SELECTED, but only one object can be ACTIVE.
 
If you "select" only one object (sheet, cell, etc.) it also becomes "active" by 
default. 

Which one you use depends on what you're trying to accomplish.
If you wish to process multiple items, you can use Select and use methods that 
act on the Selection. 
Like:
    Selection.ClearContents

Or:
     ActiveCell.ClearContents
to clear a single cell.
-----------------
To be honest, I think the use of Select and Active in VBA should be avoided.
It usually serves to slow down your code.

Think of it this way:
Excel is a PROGRAM.
What happens when you move the mouse, or using arrow keys to select a cell or 
object calls upon the USER INTERFACE portion of the program.
Selecting cell "A1" causes all sorts of stuff to be loaded into memory.

Once you've "selected" the cell, you can change the value or properties.

So, in VBA, you COULD write:

Sheets("Sheet1").Select
Range("A1").Select
Selection.Value = "Test"

What VBA does to execute this code is to CALL the USER INTERFACE to select the 
sheet, then another call to select the range, then change the value.

the same thing can be done with:

Sheets("Sheet1").Range("A1").Value = "Test"

In fact, you can even read/write to sheets that are HIDDEN!

Which, of course you cannot do if you have to select/activate the sheet.

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------

 From: Mandeep Baluja <rockerna...@gmail.com>
>To: excel-macros@googlegroups.com 
>Sent: Wednesday, December 10, 2014 8:14 AM
>Subject: $$Excel-Macros$$ Discussion
>  
>
>
>'Most of the people have asked this simple question that what is the 
>difference between activate and select method.
>
>
>'Lets Start describing this
>
>
>'Try this
>'Range("A1:A10").Select
>'Range("a3").Activate
>'Your range will selected but the activecell is "A3"
>'Activates a single cell, which must be inside the current selection. To 
>select a range of cells, use the Select method.
>
>
>'Now try this
>'Range("A1:A10").Select
>'Range("a9").Select
>'Your range will selected but it can't keep the last range selected"
>
>
>
>
>'Conclusion :- Can someone more explain it with example
>
>
-- 
>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>https://www.facebook.com/discussexcel
> 
>FORUM RULES
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
>2) Don't post a question in the thread of another member.
>3) Don't post questions regarding breaking or bypassing any security measure.
>4) Acknowledge the responses you receive, good or bad.
>5) Jobs posting is not allowed.
>6) Sharing copyrighted material and their links is not allowed.
> 
>NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
>members are not responsible for any loss.
>--- 
>You received this message because you are subscribed to the Google Groups "MS 
>EXCEL AND VBA MACROS" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to excel-macros+unsubscr...@googlegroups.com.
>To post to this group, send email to excel-macros@googlegroups.com.
>Visit this group at http://groups.google.com/group/excel-macros.
>For more options, visit https://groups.google.com/d/optout.
>
>
>    

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to