How to create a form control over a specific cell

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.
 
V

Valerio

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top