Excel - How can I make clickable boxes for cells?

Asked By Advice Pro on 27-Mar-09 03:12 PM
Somewhere I had read or saw video of a method to create clickable boxes
with Excel, but I forgot where it is. If you can find this resource then
please tell me? Anyway, how would you make clickable boxes


--
Advice Pro
------------------------------------------------------------------------
Advice Pro's Profile: http://www.thecodecage.com/forumz/member.php?userid=204
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=80030




Chip Pearson replied on 27-Mar-09 04:05 PM
Here's some simple code to add a button to a worksheet and assign a
procedure to execute when clicked.

Sub CreateButton()
Dim C As Excel.Button
Dim WS As Worksheet
Dim R As Range
Set WS = Worksheets("Sheet1")   '<<< place button on this sheet
Set R = WS.Range("C10") '<<< place button in this cell
With R
Set C = WS.Buttons.Add(.Left, .Top, .Width, .Height)
End With
With C
.AutoSize = True
.Caption = "Click Me Long Text"
.OnAction = "'" & ThisWorkbook.Name & "'!TheProc"
End With
End Sub

Sub TheProc()
MsgBox "Hello World"
End Sub




Change the lines marked with <<< to the appropriate values.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Fri, 27 Mar 2009 19:12:38 +0000, Advice Pro
danie replied on 27-Mar-09 04:09 PM
data-validation.  set up a row of cells with data you desire to use.  then do
a data validation and selec the range.