Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Control Display Area

Hi Everybody

I am using Excel 2002 and running a macro which draws shapes on a separate
worksheet within the same workbook. The Top left hand corner of my shape is
3000 points in from the left hand edge and 3000 points down from the top edge
of the drawing sheet. I need my macro to display the drawing sheet with the
top left corner of my shape in the top left corner of the window. Has anyone
got any ideas?

Many thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Control Display Area

"PraxisPete" wrote in message
...
Hi Everybody

I am using Excel 2002 and running a macro which draws shapes on a separate
worksheet within the same workbook. The Top left hand corner of my shape
is
3000 points in from the left hand edge and 3000 points down from the top
edge
of the drawing sheet. I need my macro to display the drawing sheet with
the
top left corner of my shape in the top left corner of the window. Has
anyone
got any ideas?


You could set the worksheet.activate event to:

sub worksheet_activate()
range("the range encompassing the cells under the drawing")
activewindow.zoom = true
end sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Control Display Area


you could simply use :
application.goto shp.topleftcell, true
but goto leaves traces.. so better to use scrollrow/scrollcolumn

I wouldt not use scrollintoview...
...as we'll hit on excel's confusing coordinate system...
activewindow.ScrollIntoView 3000*(96/72),3000*(96/72),1,1,true
(you need to use api's to correctly read the DPI here assumed to be 96)


Better to use ScrollRow/Column...
note Excel will scroll on a row/column basis,
so you may want to adjust your shape to exactly align
to its underlying cell..

With wks.Shapes.AddShape(msoShapeRectangle, 3000, 3000, 30, 30)
.Top = .TopLeftCell.Top
.Left = .TopLeftCell.Left
ActiveWindow.ScrollRow = .TopLeftCell.Row
ActiveWindow.ScrollColumn = .TopLeftCell.Column
End With


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


PraxisPete wrote :

Hi Everybody

I am using Excel 2002 and running a macro which draws shapes on a
separate worksheet within the same workbook. The Top left hand
corner of my shape is 3000 points in from the left hand edge and 3000
points down from the top edge of the drawing sheet. I need my macro
to display the drawing sheet with the top left corner of my shape in
the top left corner of the window. Has anyone got any ideas?

Many thanks in advance.

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
Area display help mustbezim Excel Worksheet Functions 1 March 4th 10 08:41 PM
Client area doesn't display or repaint the extended area from resi 가을시냇가 Excel Discussion (Misc queries) 1 October 7th 09 01:33 PM
two questions, Yes/No form control, and how did they create this adjustable area on the sheet... Kelvin[_2_] Excel Discussion (Misc queries) 3 November 29th 07 05:49 PM
two questions, Yes/No form control, and how did they create this adjustable area on the sheet... Kelvin[_2_] Excel Worksheet Functions 3 November 29th 07 05:49 PM
How to control the area? Allan Links and Linking in Excel 2 March 25th 05 05:39 PM


All times are GMT +1. The time now is 12:27 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"