Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count single Text in cells with multiple text entries | Excel Discussion (Misc queries) | |||
need formula for % of times text appears in row. | Excel Worksheet Functions | |||
how do i count text and display it as text plus the # times it hap | New Users to Excel | |||
how do I count the number of times text in column A matches text i | Excel Worksheet Functions | |||
=Text(b2-A2,"h") hours between 2 times, what do I do for 10 times | New Users to Excel |