Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default How do i have a check display with any data entry in a cell

I like this version a little better.

Other version had a bug that would not allow deletion of data from the range.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit
Application.EnableEvents = False
Application.ExtendList = False
If Not Application.Intersect(Range("D3:I25"), Target) Is Nothing Then
If Target.Value < "" Then 'added line
With Target
.Value = "a"
.Font.Name = "Marlett"
.FontStyle = "Regular"
.Size = 10
End With
Application.ExtendList = True
End If
End If
ws_exit:
Application.EnableEvents = True
End Sub


Gord

On Fri, 18 Nov 2005 15:58:42 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Try this amended code.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit
Application.EnableEvents = False
Application.ExtendList = False 'to prevent Marlett font extending
'out of Target Range
If Not Application.Intersect(Range("D3:I25"), Target) Is Nothing Then
With Target
.Value = "a"
.Font.Name = "Marlett"
.FontStyle = "Regular"
.Size = 10
End With
Application.ExtendList = True
End If
ws_exit:
Application.EnableEvents = True
End Sub


Gord

On Fri, 18 Nov 2005 12:52:05 -0800, "jwomack"
wrote:

That is what I wanted but how do I get it to work on only a part of the
worksheet? For instance, if you are looking at a teacher's gradebook, it
would be columns D-I and rows 3-25.

"Gord Dibben" wrote:

You could use event code behind the worksheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column 8 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
.Value = "a"
.Font.Name = "Marlett"
.FontStyle = "Regular"
.Size = 10
End With
ErrHandler:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste the event code into that module.

As written it operates on first 8 columns only.


Gord Dibben Excel MVP

On Fri, 18 Nov 2005 08:55:10 -0800, "jwomack"
wrote:

I am creating a simple spreadsheet for teachers and want to have only a check
mark displayed regardless of what they type into a cell.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Input cell reference is not valid (One Variable Data Table) Dottore Excel Worksheet Functions 9 September 1st 05 03:05 PM
Input Cell in One variable data table Dottore Magistrale Excel Worksheet Functions 0 August 30th 05 06:25 PM
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 04:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"