ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Difference between Select and Activate (https://www.excelbanter.com/excel-programming/316603-difference-between-select-activate.html)

Darlajane[_2_]

Difference between Select and Activate
 

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

--
Darlajan
-----------------------------------------------------------------------
Darlajane's Profile: http://www.excelforum.com/member.php...fo&userid=1532
View this thread: http://www.excelforum.com/showthread.php?threadid=27773


Bernie Deitrick

Difference between Select and Activate
 
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

"Darlajane" wrote in message
...

Hi,

Perhaps a silly question but I was just wondering what is the
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

Helen


--
Darlajane
------------------------------------------------------------------------
Darlajane's Profile:

http://www.excelforum.com/member.php...o&userid=15326
View this thread: http://www.excelforum.com/showthread...hreadid=277730




Tom Ogilvy

Difference between Select and Activate
 
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

--
Regards,
Tom Ogilvy

"Darlajane" wrote in message
...

Hi,

Perhaps a silly question but I was just wondering what is the
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

Helen


--
Darlajane
------------------------------------------------------------------------
Darlajane's Profile:

http://www.excelforum.com/member.php...o&userid=15326
View this thread: http://www.excelforum.com/showthread...hreadid=277730





All times are GMT +1. The time now is 04:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com