ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help to speed up adding check box (https://www.excelbanter.com/excel-programming/314556-help-speed-up-adding-check-box.html)

jono1970

help to speed up adding check box
 

hello,

I need to place 50 check boxes in column D of my worksheet. Currentl
I go to *view*, *toolbox*, *forms* and drag a check box object in to
cell. I then have to edit, size and place it within the cell. Is ther
a way to quickly replicate this in VBA. I would appreciate it i
somebody could show me how to do this.

Thanks in advance.

Jon

--
jono197
-----------------------------------------------------------------------
jono1970's Profile: http://www.excelforum.com/member.php...fo&userid=1565
View this thread: http://www.excelforum.com/showthread.php?threadid=27193


Tom Ogilvy

help to speed up adding check box
 
Turn on the macro recorder while you do it manually. then generalize the
code and put in a loop.

--
regards,
Tom Ogilvy

"jono1970" wrote in message
...

hello,

I need to place 50 check boxes in column D of my worksheet. Currently
I go to *view*, *toolbox*, *forms* and drag a check box object in to a
cell. I then have to edit, size and place it within the cell. Is there
a way to quickly replicate this in VBA. I would appreciate it if
somebody could show me how to do this.

Thanks in advance.

Jono


--
jono1970
------------------------------------------------------------------------
jono1970's Profile:

http://www.excelforum.com/member.php...o&userid=15658
View this thread: http://www.excelforum.com/showthread...hreadid=271931




Charles

help to speed up adding check box
 

Jono,

Here is a code that I recorded abd modified.

HTH


Charles


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/24/2004 by Charles Harmon
'

'
Application.CommandBars("Forms").Visible = True
Do While cnt < 50
cnt = cnt + 1
If cnt = 1 Then
mynum = 27
End If
ActiveSheet.CheckBoxes.Add(15, mynum, 72, 72).Select
Selection.ShapeRange.Height = 7#
mynum = mynum + 30
Loop
Application.CommandBars("Forms").Visible = fales
End Sub


--
Charles
------------------------------------------------------------------------
Charles's Profile: http://www.excelforum.com/member.php...fo&userid=6014
View this thread: http://www.excelforum.com/showthread...hreadid=271931


Dave Peterson[_3_]

help to speed up adding check box
 
Maybe this will help. (Adjust the range to what you need)

http://groups.google.com/groups?thre...0A8B%40msn.com

jono1970 wrote:

hello,

I need to place 50 check boxes in column D of my worksheet. Currently
I go to *view*, *toolbox*, *forms* and drag a check box object in to a
cell. I then have to edit, size and place it within the cell. Is there
a way to quickly replicate this in VBA. I would appreciate it if
somebody could show me how to do this.

Thanks in advance.

Jono

--
jono1970
------------------------------------------------------------------------
jono1970's Profile: http://www.excelforum.com/member.php...o&userid=15658
View this thread: http://www.excelforum.com/showthread...hreadid=271931


--

Dave Peterson



All times are GMT +1. The time now is 12:23 AM.

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