Range Acting Lke Control?

  • Thread starter Thread starter Phil Hageman
  • Start date Start date
P

Phil Hageman

Range C12:Z16 is merged, with typed text. Is it possible
to make this merged range operate the same as a forms
control button, such that if clicked on, the user is taken
to worksheet "Customer", Screen is sized (Zoom) to 62,
Cell "A1" selected? A forms control button is very
unsightly, and somewhat confusing - there are other
buttons working on the same screen.

Would the range, and text in the range, be created by code?
 
Hi

I suggest you make a hyperlink of the text (insert menu). Use the workbook
even
Workbook_SheetFollowHyperlink
if you need additional code running (like zoom)
 
You might consider adding a shape to the cell, perhaps a rectangle from the
Drawing toolbar. It can be formatted in many ways, and assigned a macro.
 
Add this tot he worksheet module of the required worksheet
(right-clcik the worksheet tab an select View Code)

Private Sub Worksheet_SelectionChange( _
ByVal Target As Range)
If Target.Address = "$C$12:$Z$16" Then
Sheets("Customer").Activate
Sheets("Customer").Range("a1").Select
ActiveWindow.Zoom = 62
End If
End Sub

Note that this code will run every time the selection
changes on the worksheet, though this shouldn't slow
things down by any perceivable amount...

Cheers,
Dave
 
Good question - I tried this, but I need a particular
screen zoom and cell selection for an on-screen
presentation. Can I make the hyperlink zoom?
 
I'm not familiar with this. How would I do it?
-----Original Message-----
Hi

I suggest you make a hyperlink of the text (insert menu). Use the workbook
even
Workbook_SheetFollowHyperlink
if you need additional code running (like zoom)

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Phil Hageman" <[email protected]> skrev i melding
code?


.
 
Phil Hageman said:
I'm not familiar with this. How would I do it?

Open the ThisWorkbook module. Paste this in:

Private Sub Workbook_SheetFollowHyperlink(ByVal _
Sh As Object, ByVal Target As Hyperlink)
MsgBox Target.Name
End Sub


Test it. Once you know the prompted Target.Name, say "Go here", rewrite the
code to

Private Sub Workbook_SheetFollowHyperlink(ByVal _
Sh As Object, ByVal Target As Hyperlink)
If Target.Name = "Go here" Then
ActiveWindow.Zoom = 60
End If
End Sub
 
Back
Top