Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Macro to move a cell to centre screen

I want to write a simple macro that will make a given cell (defined by the
contents of two other cells - i.e. row number and column number) move to
the centre of the screen (approximately).

Is there a simple way in which I can do this please? I can't find a function
to do it.

Thanks,

V



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Macro to move a cell to centre screen

Try this:
Sub GotoSpecifiedCell()
'Assumes Range "A1" holds the row number &
'Range "A2" holds the column number
Application.Goto Reference:=Cells(Range("A1").value, Range("A2").value), _
Scroll:=True
With ActiveWindow
.SmallScroll Up:=(.VisibleRange.Rows.Count / 2), _
ToLeft:=(.VisibleRange.Columns.Count / 2)
End With
End Sub

--
Charles Chickering

"A good example is twice the value of good advice."


"Victor Delta" wrote:

I want to write a simple macro that will make a given cell (defined by the
contents of two other cells - i.e. row number and column number) move to
the centre of the screen (approximately).

Is there a simple way in which I can do this please? I can't find a function
to do it.

Thanks,

V




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Macro to move a cell to centre screen

Many thanks,

V


"Charles Chickering" wrote in
message ...
Try this:
Sub GotoSpecifiedCell()
'Assumes Range "A1" holds the row number &
'Range "A2" holds the column number
Application.Goto Reference:=Cells(Range("A1").value,
Range("A2").value), _
Scroll:=True
With ActiveWindow
.SmallScroll Up:=(.VisibleRange.Rows.Count / 2), _
ToLeft:=(.VisibleRange.Columns.Count / 2)
End With
End Sub

--
Charles Chickering

"A good example is twice the value of good advice."


"Victor Delta" wrote:

I want to write a simple macro that will make a given cell (defined by
the
contents of two other cells - i.e. row number and column number) move to
the centre of the screen (approximately).

Is there a simple way in which I can do this please? I can't find a
function
to do it.

Thanks,

V






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
Move/Scroll Specific Cell(Row) into the centre of the Screen ? Corey Excel Programming 4 January 8th 07 06:42 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
How to display the cell it goes to at the centre of the monitor screen cyberdude Excel Programming 1 July 23rd 06 10:18 AM
Macro to Move Selected Cell to Top of Screen snsd[_2_] Excel Programming 1 October 31st 04 09:47 AM
Macro to Move Selected Cell to Top of Screen snsd Excel Programming 1 October 31st 04 12:29 AM


All times are GMT +1. The time now is 12:14 AM.

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"