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 / New Users / August 2007

Tip: Looking for answers? Try searching our database.

Format/Input question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick Price - 03 Aug 2007 03:57 GMT
Is there away to have a checkbox in a cell so that all that can be
entered would be an X for nothing?
Dave Peterson - 03 Aug 2007 13:04 GMT
You could give the cell a custom format so that the cell displays an x no matter
what's typed in the cell--the cell will still contain whatever they type (as
seen in the formula bar), but it'll display an x.

Select the range
format|Cells|number tab|custom category
X;X;X;X

Another option would be to use a worksheet event that replaces anything with an
X.

If you want to try, right click on the worksheet tab that should have this
behavior and select view code.  Then paste this into the newly opened
codewindow:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
   With Target
       If .Cells.Count > 1 Then Exit Sub
       If Intersect(.Cells, Me.Range("A:a")) Is Nothing Then Exit Sub
       
       On Error GoTo ErrHandler:
       
       If IsEmpty(.Value) Then Exit Sub
       
       Application.EnableEvents = False
       .Value = "X"
   End With
       
ErrHandler:
       Application.EnableEvents = True
       
End Sub

I used any cell in column A, but you can change the range to what you wanted.

> Is there away to have a checkbox in a cell so that all that can be
> entered would be an X for nothing?

Signature

Dave Peterson

Rick Price - 05 Aug 2007 04:24 GMT
Thanks

> You could give the cell a custom format so that the cell displays an x no matter
> what's typed in the cell--the cell will still contain whatever they type (as
[quoted text clipped - 34 lines]
>> Is there away to have a checkbox in a cell so that all that can be
>> entered would be an X for nothing?
 
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.