How to create a form control over a specific cell

  • Thread starter Thread starter Valerio
  • Start date Start date
V

Valerio

I'm trying to automatically create form controls such as check boxes and put
them on a work sheet.
The function that has to be called appear to be

ActiveWorksheet.Shapes.AddFormControl(xlCheckBox,Left,Top,Width,Height)

I'd like it to be placed over a specific cell but AddFormControl requires
coordinates in pixels. Is there any way to get the pixel coordinates of a
cell? Do you know any other way to accomplish this task?

Thank you.
 
Valerio said:
I'm trying to automatically create form controls such as check boxes and put
them on a work sheet.

Ok, I found the answer by myself... I'm posting it here if someone else need
it.

Set c = ws.Range("c32")
Set cb = ws.Shapes.AddFormControl(xlCheckBox, c.left, c.top,
c.Width,c.Height)

The properties left / top etc. are what I needed.

Thank you
 
Back
Top