Difference between Select and Activate

D

Darlajane

Hi,

Perhaps a silly question but I was just wondering what is th
difference between something like:

range("A2").select

and

range("A2").activate

?

And in what situations would you want to use either one?

Thanks for your help

Hele
 
B

Bernie Deitrick

There isn't any difference with a single cell range.

But you could use

Range("A1:A10").Select
Range("A2").Activate

to select A1:A10, with A2 being the activecell.

Using:

Range("A1:A10").Activate

will default to A1 being the activecell.

There is rarely a need to select or activate a range to use it in VBA.

HTH,
Bernie
MS Excel MVP
 
T

Tom Ogilvy

Range("A1:B9").Select
Range("A2").Activate

Results is A1:B9 is selected and A2 is the active cell

Range("A1:B9").Select
Range("A2").Select

Results is A2 is the single cell selected (and is the active cell).

If A2 is not in the current selection then

Range("A2").Select
Range("A2").Activate

are the same.

as are

Range("A1:B9").Select
Range("A1:B9").Activate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top