View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
FMBC Technical Director FMBC Technical Director is offline
external usenet poster
 
Posts: 1
Default What is the difference between 'Select' a sheet and 'Activate' a sheet

On Oct 29, 7:23*am, Ron Rosenfeld wrote:
On Thu, 28 Oct 2010 20:52:07 -0700 (PDT), Pat Quatman





wrote:
Rather than


' This is what I had been doing that seemed to cause the problem - a
snippet for sample purposes of course.


Sub PickAPage ()


* * ThisWorkbook.Worksheets("Consolidation").Select
* * * * *Range("z9").Activate


End Sub


' -------------------------
or


This was my first attempt at a solution, which seemed to work at the
moment anyway - not sure about the long term though


Sub PickAPage ()


* * ThisWorkbook.Worksheets("Consolidation").Activate


* * * * Range("z9").Activate


End Sub


I don't understand why your first example should have been causing
problems, unless perhaps the worksheet was not a a worksheet, but
rather a chart sheet.

For data input, I would
* * * * select the proper worksheet
* * * * activate the cell
* * * * scroll the cell to the top left corner.

e.g:

*With Worksheets("sheet2")
* * * * .Select
* * * * .Range("z9").Activate
* * End With
* * Application.Goto ActiveCell, scroll:=True

But if this is for general usage, and not just personal usage, you
might find you have better control by having the data input on a user
form instead of directly on the sheet. *You can probably make it look
better, also.- Hide quoted text -

- Show quoted text -


Thanks for the suggestion, although that might not be practical.
Perhaps I should explain a little more - although I think the problem
may be resolved now. I sure hope so.

The user, who is the tabulator at a competitive event, inputs up to
ninety rows of data, which are scoring details from a marching band
conest - their input is the scores of the judges, and there are up to
12 judges at a contest, and our largest contests will have over 90
bands involved at four sites.

the bands that compete can compete in various classes (up to 10
classes, with a maximum of 20 - 30 bands in each class, depending on
the class). Therefore there are hundreds of lines for potential data
entry. The user tells the program which classes are active in their
contest, and how many bands in that class, and the program hides the
unused lines from the display.

The tabluator enters the scores over an 8-12 hour period as bands
compete. The program then calculates winners of individual captions,
ratings of bands in individual captions, class winners, individual
winners, and overall winners. At multi-stage events, it provides
printable output giving the names of the bands that move on to the
next stage of competition as well, in a quasi-narrative format. It
also outputs tables showing winners, rankings and ratings in
subcaptions, etc., etc. I had been developing it and refining it
since 2001, and had just completed it when Microsoft redesigned Excel.
I had to do a total rewrite, as I had been using drop-down menus that
would not have been visible to the casual user with Excel 2007. The
rewrite had a few bugs that I resolved in 2008-2009.

At this point it is about 10 megs in size, and seemed to be working
fine. Once again, I thought I was done until this strange behaviour
started about ten days ago.

We are in the heart of our season, which concludes just before
Thanksgiving, with multiple contests using the program every weekend.
It is critical that it not crash at a competitive event, as the
tabulator would have to spend a great deal of time with manual
calculations at a critical time at the event.

In response to your comment/question about why it failed, I hope it
does not fail with example 1 - I just put that into place last week
and the first test of the program with that configuration will be
tomorrow, Saturday, at several locations in Florida USA. The failure
was with example 2, which used the Select command - example 1 was my
attempt at a fix, a fix that I was not certain would work.

I am afraid a userform approach would not be appropriate because the
users like to look at their entries in a traditional table form as
they enter them. The way it is set up now works very well, when it
works, and it is traditional as far as the user can see entering
data. So my only question was if it would be less likely to crash by
using the references...we will see what the weekend brings.

Thank you so much for your help.