Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default How to display the cell it goes to at the centre of the monitor screen

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default How to display the cell it goes to at the centre of the monitor screen

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
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
how to set up a page to display full screen on any size monitor davey139 Excel Discussion (Misc queries) 1 May 24th 09 08:12 AM
How to display the cell it goes to at the centre of the monitor screen? cyberdude Excel Discussion (Misc queries) 1 July 23rd 06 01:20 PM
excel cell data won't display on monitor Brad Excel Discussion (Misc queries) 6 July 10th 06 11:31 PM
how do i centre headings accross the screen in excell? Sethius Excel Discussion (Misc queries) 1 February 1st 05 10:46 AM
How to change resolution of monitor/screen Glen Mettler Excel Programming 1 November 19th 03 02:37 PM


All times are GMT +1. The time now is 08:18 PM.

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

About Us

"It's about Microsoft Excel"