Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 135
Default Allow times OR certain text entries

I have a range of cells that use the Time Quick Entry method from Chip
Pearson's website. I want to allow specific text entries ("DQ" or "DNS") but
I don't want to allow any other text entries. I added the following code to
allow the text, and convert it to all caps, but I'm not sure how to prevent
other text entries?

If Application.WorksheetFunction.IsText(Target.Value) = True Then
Application.EnableEvents = False
Target.Value = StrConv(Target.Value, vbUpperCase)
Application.EnableEvents = True
Exit Sub
End If

Thanks,
~ Horatio
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,089
Default Allow times OR certain text entries

Something like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Application.WorksheetFunction.IsText(Target.Value) = True Then
Application.EnableEvents = False
Target.Value = StrConv(Target.Value, vbUpperCase)
If Target.Value < "DQ" And Target.Value < "DNS" Then
Target.Value = ""
End If
Application.EnableEvents = True
Exit Sub
End If
End Sub

Regards

Trevor


"Horatio J. Bilge, Jr." wrote in
message ...
I have a range of cells that use the Time Quick Entry method from Chip
Pearson's website. I want to allow specific text entries ("DQ" or "DNS")
but
I don't want to allow any other text entries. I added the following code
to
allow the text, and convert it to all caps, but I'm not sure how to
prevent
other text entries?

If Application.WorksheetFunction.IsText(Target.Value) = True Then
Application.EnableEvents = False
Target.Value = StrConv(Target.Value, vbUpperCase)
Application.EnableEvents = True
Exit Sub
End If

Thanks,
~ Horatio



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 135
Default Allow times OR certain text entries

That is exactly what I was thinking of. I just wasn't sure exactly how to
code it. Thanks!
~ Horatio

"Trevor Shuttleworth" wrote:

Something like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Application.WorksheetFunction.IsText(Target.Value) = True Then
Application.EnableEvents = False
Target.Value = StrConv(Target.Value, vbUpperCase)
If Target.Value < "DQ" And Target.Value < "DNS" Then
Target.Value = ""
End If
Application.EnableEvents = True
Exit Sub
End If
End Sub

Regards

Trevor


"Horatio J. Bilge, Jr." wrote in
message ...
I have a range of cells that use the Time Quick Entry method from Chip
Pearson's website. I want to allow specific text entries ("DQ" or "DNS")
but
I don't want to allow any other text entries. I added the following code
to
allow the text, and convert it to all caps, but I'm not sure how to
prevent
other text entries?

If Application.WorksheetFunction.IsText(Target.Value) = True Then
Application.EnableEvents = False
Target.Value = StrConv(Target.Value, vbUpperCase)
Application.EnableEvents = True
Exit Sub
End If

Thanks,
~ Horatio




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,089
Default Allow times OR certain text entries

You're welcome. Thanks for the feedback.


"Horatio J. Bilge, Jr." wrote in
message ...
That is exactly what I was thinking of. I just wasn't sure exactly how to
code it. Thanks!
~ Horatio

"Trevor Shuttleworth" wrote:

Something like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Application.WorksheetFunction.IsText(Target.Value) = True Then
Application.EnableEvents = False
Target.Value = StrConv(Target.Value, vbUpperCase)
If Target.Value < "DQ" And Target.Value < "DNS" Then
Target.Value = ""
End If
Application.EnableEvents = True
Exit Sub
End If
End Sub

Regards

Trevor


"Horatio J. Bilge, Jr." wrote
in
message ...
I have a range of cells that use the Time Quick Entry method from Chip
Pearson's website. I want to allow specific text entries ("DQ" or
"DNS")
but
I don't want to allow any other text entries. I added the following
code
to
allow the text, and convert it to all caps, but I'm not sure how to
prevent
other text entries?

If Application.WorksheetFunction.IsText(Target.Value) = True Then
Application.EnableEvents = False
Target.Value = StrConv(Target.Value, vbUpperCase)
Application.EnableEvents = True
Exit Sub
End If

Thanks,
~ Horatio






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
Count single Text in cells with multiple text entries WSC Excel Discussion (Misc queries) 6 January 9th 07 04:17 PM
need formula for % of times text appears in row. sunslight Excel Worksheet Functions 2 September 29th 06 08:47 PM
how do i count text and display it as text plus the # times it hap Count in Excel New Users to Excel 1 April 26th 06 10:15 AM
how do I count the number of times text in column A matches text i Sheila Excel Worksheet Functions 2 November 16th 05 10:20 PM
=Text(b2-A2,"h") hours between 2 times, what do I do for 10 times Jayda New Users to Excel 3 May 18th 05 05:53 PM


All times are GMT +1. The time now is 06:58 PM.

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

About Us

"It's about Microsoft Excel"