LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for checkbox generation


Hi all,

I'm not the most experienced of Excel users so please bear with me. I'
looking to generate a macro (because I'm lazy) that will place about 50
checkboxes in a single column, row by row. It also needs to move an
resize according to the data in an adjacent cell (i.e. if the text nex
to it is too large and wordwraps another line, the box must move wit
it). One checkbox per row is what I'm getting at.

This is the code I'm currently using:
Dim myCBX As CheckBox
Dim myCell As Range

With ActiveSheet
.CheckBoxes.Delete 'nice for setting up
For Each myCell In ActiveSheet.Range("O13:O503").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)

With myCBX
.LinkedCell = myCell.Address(external:=True)
.Caption = ""
.Name = "CBX_" & myCell.Address(0, 0)

End With
.NumberFormat = ";;;"
End With

Next myCell
End With
End Sub

Please and thanks

--
rmcveig
-----------------------------------------------------------------------
rmcveigh's Profile: http://www.excelforum.com/member.php...fo&userid=3735
View this thread: http://www.excelforum.com/showthread.php?threadid=57145

 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
checkbox = macro? ephyk Excel Discussion (Misc queries) 1 August 25th 08 12:36 AM
Checkbox Macro [email protected] Excel Discussion (Misc queries) 3 November 5th 07 07:11 PM
Macro for checkbox (2) es Excel Discussion (Misc queries) 0 April 5th 05 01:48 PM
macro with checkbox(i) costas Excel Programming 2 October 4th 04 12:49 PM
VBA Macro - correlations in random number generation jomni Excel Programming 0 April 1st 04 02:07 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"