I like this idea by rich007a. Can't seem to get it to work properly though.
My original post was (http://answers.microsoft.com/en-us/office/forum/office_2007-customize/hyperlink-image-move-to-top-of-page/7400c0bd-831f-48bd-994a-2e43f3ac21fa)
With no luck, by trying to use Images to link to the a particular cell and being it to the top of the window.
Sub AllBtnClick()
Dim rng As Range
Select Case ActiveSheet.Shapes(Application.Caller).AlternativeText
Case "Text on btn1": Set rng = Worksheets("Sheet1").Range("A110:B111")
Case "Text on btn2": Set rng = Worksheets("Sheet2").Range("C110:D111")
Case "Text on btn3": Set rng = myNamedRange
Case Else ' do nothing
End Select
Application.Goto rng, scroll:=True
End Sub
Here is what I am doing.
- I add the Shape I want to a Sheet - Write in the Text I want (Monday)
- Change Text on btn1 to Monday -Sheet1to Creator (name of the sheet I am using) - A110:B111 to
A9:A10.
- The code above is put into the View Code for that particular sheet.
Any assistance would be great.
-----------------------------------------------------------------------------------------Edit
SOLUTION TO MY QUESTION:
Here is the code that I needed for linking Shapes to cells to work.
So everyone knows how to use the code...
- Insert the desired shape..
- Write in what you want in the Shape. (in this example, Monday)
- Right-Click and select Size and Properties -****Select Alt Text
- Write in the same Text as you put in the Shape (Monday)
- Right-Click on the Sheet you have the shape in and click - View Code
- Past this in the blank area in Microsoft Visual Basic
Sub AllBtnClick()
Dim rng As Range
Select Case ActiveSheet.Shapes(Application.Caller).AlternativeText
Case "Monday": Set rng = Range("A9:A10")
Case Else ' do nothing
End Select
Application.Goto rng, scroll:=True
End Sub
Save and close.
This should allow you to Click on the desired cell and link it to any particular cell Range in your Sheet.
---- Note
If you want it to link to another sheet.. Use this code.
Sub AllBtnClick()
Dim rng As Range
Select Case ActiveSheet.Shapes(Application.Caller).AlternativeText
Case "Monday": Set rng = **Worksheets("Sheet2").**Range("A9:A10")
Case Else ' do nothing
End Select
Application.Goto rng, scroll:=True
End Sub
The only thing different is "Worksheets("Creator")." which is added infront of "Range."