ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to create a form control over a specific cell (https://www.excelbanter.com/excel-programming/297772-how-create-form-control-over-specific-cell.html)

Valerio

How to create a form control over a specific cell
 
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,L eft,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

How to create a form control over a specific cell
 
"Valerio" ha scritto nel messaggio
...
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




All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com