Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default AddTextBox Position Fix

Hi,

I am trying to add a textbox shape to a cell but the zoom level seems to
effect its position. Does anyone know a way of calculating the correct
position regardless of zoom level?

The problem can be seen by running this code:

Sub AddTextBoxesAtDifferentZoomLevels()
Dim rngCell As Range
Dim sngWidthHeight As Single
Dim iZoom As Integer
Dim ioff As Integer
Dim Irow As Integer
'note: row height also affects the layout
sngWidthHeight = 10
For Irow = 1 To 201 Step 50
Set rngCell = Range("A1").Cells(Irow, 1)
ioff = 0
For iZoom = 10 To 200 Step 10
ActiveWindow.Zoom = iZoom
rngCell.Offset(0, ioff) = iZoom
Set shpNew =
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, rngCell.Offset(0,
ioff).Left, rngCell.Top, sngWidthHeight, sngWidthHeight)
ioff = ioff + 1
Next
Next
End Sub


Note each box is supposed to be in a cell on row 0,50,100,150 or 200.

--
Thanks, Matt
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
Look up a value which position changes. David_in_AUS Excel Discussion (Misc queries) 1 June 13th 06 09:01 AM
Position of CellCursor on Screen (absolute position) [email protected] Excel Programming 1 November 23rd 05 02:23 AM
parameters AddTextbox piet Excel Programming 1 September 11th 05 02:30 PM
Position of Chr(10) Zurn[_28_] Excel Programming 3 July 18th 05 10:32 AM
.position chazman Charts and Charting in Excel 4 February 28th 05 02:26 AM


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