Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / November 2006

Tip: Looking for answers? Try searching our database.

How to set up a template to click on a box and an "X" will appear

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Irishsuly - 27 Nov 2006 19:09 GMT
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 - 27 Nov 2006 19:48 GMT
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

>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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.