View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Bash Dave Bash is offline
external usenet poster
 
Posts: 11
Default Moving the Active cell to the left of the screen

I am trying to move the active cell so that its column is displayed as
the leftmost column on my screen.

I have two sheets - one with a Titles across the top row and the
second with a list of those titles. I want to be able to double click
on the second sheet item, have it match the column on the first. This
part works fine. The issue is how to have the chosen title display in
the left most column of my screen.

Thanks.

My code:
__________________________________________________ ______________________________
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Target.Column = 2 And Target.Value < "" Then jumpToHist
Target.Value
End Sub

Sub jumpToHist(tgt As String)
On Error Resume Next
col = Application.Match(tgt, Worksheets("Hist
(2)").Range("Print_Titles"), 0)

With Sheets("Hist (2)")
.Activate
.Cells(1, col).Activate
End With
On Error GoTo 0

End Sub