Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Look up a value which position changes. | Excel Discussion (Misc queries) | |||
Position of CellCursor on Screen (absolute position) | Excel Programming | |||
parameters AddTextbox | Excel Programming | |||
Position of Chr(10) | Excel Programming | |||
.position | Charts and Charting in Excel |