View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Placement of Code

Missed the merged cells in the original message.


right click on the sheet tab of the scorecard sheet and select view code.
Paste in the resulting module.

Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = Range("E20").MergeArea.Address Then
Application.ScreenUpdating = False
Sheets("Customer").Select
Sheets("Customer").Range("A33").Select
ActiveWindow.Zoom = 62
ActiveWindow.ScrollRow = 33
ActiveWindow.ScrollColumn = 1
Application.ScreenUpdating = True
End If
End Sub


And it does work fine for me using a merged cell area.

--
Regards,
Tom Ogilvy



"Phil Hageman" wrote in message
...
Thanks for your reply, Brian. I put it there but it doesn't activate when

I click cell E20. The object he When the user clicks the merged cell
range in the "Scorecard" worksheet (populated by a formula in the cell,
=IF(G20<"","1.2:",""), when they make a text entry in cell G20), they are
moved to the "Customer" worksheet, cell A33 is selected, window zoomed to
62%, and cell A33 is placed in the upper left corner of the screen. The
author of this code tested it and said it worked for him. Any idea of what
I am doing wrong?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$E$20" Then
Application.ScreenUpdating = False
Sheets("Customer").SelectPrivate
Sheets("Customer").Range("A33").Select
ActiveWindow.Zoom = 62
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Application.ScreenUpdating = True
End If
End Sub