Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Moving the Active cell to the left of the screen

All you need is this:

Application.Goto Sheets("Hist (2)").Cells(col, 5), True

instead of this:

With Sheets("Hist (2)")
.Activate
.Cells(1, col).Activate
End With

--
Jim Rech
Excel MVP


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen does not scroll as active cell moves down the page KimC Excel Discussion (Misc queries) 3 May 8th 07 06:45 PM
how do I keep the active cell or row in the middle of the screen RLD7 Excel Discussion (Misc queries) 1 April 19th 06 03:05 PM
Active cell moves off the screen John W. Excel Discussion (Misc queries) 1 November 15th 05 11:12 PM
Moving active cell after copy T Pitts Excel Programming 6 October 17th 03 08:16 PM
Moving active cell Scott Excel Programming 1 July 31st 03 05:52 PM


All times are GMT +1. The time now is 04:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"