Activate and Select range/worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could someone kindly explain or refer me to some sources where I can
distingush between "activation" and "selection" of ranges? and worksheets?

I am quite confuse with the two concepts.

Thanks.

zhj23
 
You can find some verbage on it in the VBA help files, in the VBA documentation
for Excel. Look for selecting and activating. Basically, you can Activate
a cell within a selection. When you select a sheet, range or object you
activate it. So activate and select can be used interchageably on most
objects.
 
Select A1:B3
then use the tab to activate each cell in the selection.

The activecell is changes with each strike of the tab key. The selection
doesn't change.

Create a test workbook with a handful of worksheets.
Click on the first worksheet and ctrl-click on subsequent sheets.
You've selected a few sheets.

In that set of selected sheets, you can activate any one you want. Not too
dissimilar to the cells in the range.
 
Welcome to the club. I've read a couple small books about VBA, the help
files, and quite a bit on here. I've worked with 4 or 5 programing
languages, in fact I first learned Basic when it was developed at
Dartmouth and you had to get up at 3 in the morning to have your cards
run through the reader and it spit out a bunch of errors.

It just looks to me like some half drunk committee sat down and decided
to develop the most confusing and misleading language possible in VBA.
There is no particular syntax or structure to it. There is no particular
way to do anything... there are 8 or 9 ways and 10 to 20 different names
for them. It is like an example of exactly how not to develop a
programming language. The only good news is that it meshes with Office
products pretty well.

You will find the same sort of confusion in terminology and description
time and time again if you delve deeper into VBA... It's endless.

John
 
Good explanation!!

You mean we can only activate "a" cell and CANNOT activate "a range"? Range
CAN only be "selected" and not "activated"?

zhj23
 
Thanks for the good entertainment.

I have also gone through that experience of punching several holes on the
cards, only to be thrown out later 30 years ago.

Looks like we have also to be half-drunk before we can fully understand the
VBA language.

Cheers!!

zhj23
 
Mostly, I agree with you. If the range is exactly one cell, then I don't see a
difference.

But technically, you can activate a range:

This won't fail in code:
Range("a1:b3").Activate
So you can activate a range.
 

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

Back
Top