Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
After I have entered a value, I go to the cell holding the value by the command Range.("cell_address").select to check what value I have entered. It always goes to the cell I selected. It sometimes display the target cell at the centre of the monitor screen but sometimes it doesn't. How can I always make it display the target cell at the centre of the monitor screen or somewhere as near it as possible? Thank you. David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
following seems to work... Sub Test() Centre Range("z123") End Sub Sub Centre(r As Range) Dim x&, y& Dim l&, u& Application.ScreenUpdating = False Application.Goto r, True With ActiveWindow With .VisibleRange x = .Left - .Width / 2 + ActiveCell.Width y = .Top - .Height / 2 + ActiveCell.Height l = .Columns.Count u = .Rows.Count End With Do While l 0 And x 0 And .VisibleRange.Left x l = l - 1 .SmallScroll ToLeft:=1 Loop Do While u 0 And y 0 And .VisibleRange.Top y u = u - 1 .SmallScroll Up:=1 Loop End With Application.ScreenUpdating = True End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam cyberdude wrote in groups.com Hi, After I have entered a value, I go to the cell holding the value by the command Range.("cell_address").select to check what value I have entered. It always goes to the cell I selected. It sometimes display the target cell at the centre of the monitor screen but sometimes it doesn't. How can I always make it display the target cell at the centre of the monitor screen or somewhere as near it as possible? Thank you. David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to set up a page to display full screen on any size monitor | Excel Discussion (Misc queries) | |||
How to display the cell it goes to at the centre of the monitor screen? | Excel Discussion (Misc queries) | |||
excel cell data won't display on monitor | Excel Discussion (Misc queries) | |||
how do i centre headings accross the screen in excell? | Excel Discussion (Misc queries) | |||
How to change resolution of monitor/screen | Excel Programming |