Macro to select after activation

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

AngelaCasale

Thread Starter
Joined
Oct 31, 2011
Messages
3
Hi All, I am very new to macros and would like some help!

I work in a school and have created a spreadsheet that tracks each students progress in maths. On on sheet I have a fed sheet from the input that bring through and individual students progress. I have created macros that move around this sheet as it is aimed for staff that arent too friendly with excel. The macros jump to name ranges. However once they jump there they are still selected which knocks out my formatting where I have hidden text by making it white.

So far I have

Application.Goto Reference:="Overview"

I have tried figuring it out on my own but now joy. Tried deselect etc but I dont really know what I am doing!

Any help would be much appreciated.

Regards

Angela :)
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,641
Hi Angela, welcome to the forum.
I hope you excuse me, but I cannot picture what you mean or what you are trying to chieve.
Is it possible to post a sample without the sensitive data?
If "Overview" is a renage, the moment you dor Application.Goto it it will select the whole range when found, but as far as I understand you don't want the whole range selected.
If Overview is als a worksheet the you can go to that sheet by saying Sheet("Overview").Activate
But like I said, I cannot picture what you are doing so it's difficult to explain and solve (for me at least)
Also, you forgot to mention which version of Excel you are using, not that that will clarify the issue but it's handy for the one who is trying to help you.
 

AngelaCasale

Thread Starter
Joined
Oct 31, 2011
Messages
3
Hi Hans, thanks.

Yeh its excel 2010.

I understand how I wrote it was a little confusing sorry. There is one worksheet that has lots of information on it. The teachers only need to see a collection of information at a time so I have created the macro buttons so they can navigate straight to that information within the sheet. Therefore the screen shows only the selected cells (as I have made them fill one screen size). So once it has put this into the screen view, I would like to deselect it.

Hope this makes more sense.

Angela
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,641
Hi Angela,

It doesn't make sense to me, at least I can't picture it.
If the data does not contain sensitive data maybe you could post a sample?
 

AngelaCasale

Thread Starter
Joined
Oct 31, 2011
Messages
3
I have removed sensitive data and just attached the relevant sheet with no formulas just the macros and the sheet. If you use them you can see what they are trying to do and why they arent working properly. Hope this is ok.

Regards

Angela
 

Attachments

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,641
I'll take a quick look this evening and let you know if I see anything that I can solve.
I'll see if I have the time, I'm leaving the country for almost 3 weeks, but I'll put it my ToDo list
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,641
I did a quick qone, Check module2 and see the Function GetStartAddress I wrote
You can click the 7 Years and see the difference, add tha same line but with the corresponding range address as in Module 2 for 7_years and it whould do the job (I hope)

Else you'll have to wait til after Nov 24
 

Attachments

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,641
I grouped your macro buttons to one named MyButton

I used the references to trigger the macros just a way of keeping it easy to maintain, it uses the button's caption to filter
Just a way of approaching the use of buttons an avoiding to have to write a different macro.

Like I said I won't be on-line 'til around November 22.
 

Attachments

Joined
Sep 4, 2003
Messages
4,916
Instead of using Application.Goto Reference use the line below to select only the first cell in the range instead of the entire named range. If the first cell contains hidden text also you can always include an extra empty cell in your named range and the macro would select it instead or you could also use the "offset" function to select the cell just above the first cell in the range.

Code:
Range("Year_7")(1).Select
Here is an example of how to select the cell immediately above the first cell in the named range.

Code:
Range("Year_7")(1).Offset(-1, 0).Select
To select the first cell to the left of the named range you can use the line below.

Code:
Range("Year_7")(1).Offset(0, -1).Select
Rollin
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top