How can I make clickable boxes for cells?

A

Advice Pro

Somewhere I had read or saw video of a method to create clickable boxe
with Excel, but I forgot where it is. If you can find this resource the
please tell me? Anyway, how would you make clickable boxe
 
C

Chip Pearson

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)
 
D

daniel

data-validation. set up a row of cells with data you desire to use. then do
a data validation and selec the range.
 
Top