Thread: Cell as Button
View Single Post
  #2   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Keyser,

Presumably, you want clicking the cell to activate some macro code. You can
use the Selection_Change event to make any cell act as a button. This goes
in a sheet module:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Range("MyRange"), Target) Is Nothing Then
''' put your code here, or a call to it.
End If
End Sub

The best you can do to make it look like a button is Format - Cells -
Borders, and Fill colors and patterns. It won't be real obvious to the user
that it's a button. I generally put a real button inside the cell (assigned
to the macro), and label it in the cell.
--
Earl Kiosterud
www.smokeylake.com

wrote in message
oups.com...
I can add a button to my sheet, but it seems to float over the cells.
Can I add a button so that it is in a cell? Or, alternatively, change
a cell so that it looks and behaves like a button?

Thanks