ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to set up a template to click on a box and an "X" will appear (https://www.excelbanter.com/excel-worksheet-functions/120296-how-set-up-template-click-box-x-will-appear.html)

Irishsuly

How to set up a template to click on a box and an "X" will appear
 
I am trying to set up a template so that I can just click on a cell and an
"X" will appear. Can this be done in Excel?

T. Valko

How to set up a template to click on a box and an "X" will appear
 
Here's a macro by Bob Phillips and Dave Peterson:

This procedure let's you click on a cell in a range (defined in the code)
and places a "X" in that cell.

Bob Phillips, Dave Peterson

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myHeight As Double
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
With Target
If .Value = "r" Then
.Value = ""
Else
myHeight = .EntireRow.RowHeight
.Value = "r"
.Font.Name = "Marlett"
.EntireRow.RowHeight = myHeight
End If
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub



This is sheet code.

Right click the sheet tab and paste into the window that opens.

If you click a cell in the range A1:100 a "X" will be placed in that cell.
If you select that cell again the "X" will be removed.

Biff

"Irishsuly" wrote in message
...
I am trying to set up a template so that I can just click on a cell and an
"X" will appear. Can this be done in Excel?





All times are GMT +1. The time now is 12:45 PM.

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