Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default THIS IS A BUG

Object positioning is set to "Move but don't size with cells"

Uset this code to add checkboxes to a 25Rx4C selection of cells:

Sub SAM()
Dim c As Range
Dim lb As Shape

For Each c In Application.Selection
With ActiveWorkbook.ActiveSheet
Set lb = .Shapes.AddFormControl(xlCheckBox, c.Left + (c.Width / 3),
c.Top, 0, 12.75)
lb.TextFrame.Characters.Text = ""

lb.ControlFormat.LinkedCell = c.Address

End With
Next
End Sub

Try to insert single entire rows in the set of checkboxes. Randomly, a row
of check boxes will move with the inserted row. Next randomly, the checkboxes
will not move with the inserted row. This ain't right...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default THIS IS A BUG

Checkboxes have minimum HxW dimensions, in my system 16.5 x 23.25.

You are trying to set the height to 12.75, presumably your row height. Put a
break in your code and in the locals window look at the height of the lb
shape.

When you come to insert rows part of the checkbox will be in the row below
and possibly its Top may actually be slightly above the row you thought it
was.

Together with the fact the option Size with cells is not available it's not
surprising unpredictable things occur when you insert rows. It might be an
idea to set your row height to at least 16.5, certainly before inserting
rows and perhaps also before adding your checkboxes.

Regards,
Peter T

"SamB" wrote in message
...
Object positioning is set to "Move but don't size with cells"

Uset this code to add checkboxes to a 25Rx4C selection of cells:

Sub SAM()
Dim c As Range
Dim lb As Shape

For Each c In Application.Selection
With ActiveWorkbook.ActiveSheet
Set lb = .Shapes.AddFormControl(xlCheckBox, c.Left + (c.Width / 3),
c.Top, 0, 12.75)
lb.TextFrame.Characters.Text = ""

lb.ControlFormat.LinkedCell = c.Address

End With
Next
End Sub

Try to insert single entire rows in the set of checkboxes. Randomly, a row
of check boxes will move with the inserted row. Next randomly, the

checkboxes
will not move with the inserted row. This ain't right...



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



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