Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am just working on a simple data validation code, and its not working.
Any help would be appreciated. Thanks in advance Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "A:A" Then If Len(Target) 5 Then MsgBox "Must be 5 or less Characters" Target.ClearContents End If End If End Sub -- Ariel Dugan Assistant Manager Down To Earth Natural Foods |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi AD108,
Try changing: If Target.Address = "A:A" Then to If Target.Column = 1 Then However, why not use Excel's data validation rather than even code? --- Regards, Norman "AD108" wrote in message ... I am just working on a simple data validation code, and its not working. Any help would be appreciated. Thanks in advance Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "A:A" Then If Len(Target) 5 Then MsgBox "Must be 5 or less Characters" Target.ClearContents End If End If End Sub -- Ariel Dugan Assistant Manager Down To Earth Natural Foods |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi AD108,
even code == event code --- Regards, Norman |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Norman,
I appreciate the help. I am just trying to learn the language, I'm not actually trying to accomplish anything. -- Ariel Dugan Assistant Manager Down To Earth Natural Foods 808-947-7678 Phone 808-943-8491 Fax 808-282-5916 Cell "Norman Jones" wrote in message ... Hi AD108, Try changing: If Target.Address = "A:A" Then to If Target.Column = 1 Then However, why not use Excel's data validation rather than even code? --- Regards, Norman "AD108" wrote in message ... I am just working on a simple data validation code, and its not working. Any help would be appreciated. Thanks in advance Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "A:A" Then If Len(Target) 5 Then MsgBox "Must be 5 or less Characters" Target.ClearContents End If End If End Sub -- Ariel Dugan Assistant Manager Down To Earth Natural Foods |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Norman,
I used Excel's validation and it works fine until a new row is added and the validation moves down. My spreadsheet has a routine wich adds a new data row at row3 for the new entry. The validation moves with the old row 3 to row 4 vwith the old data. The routine also specifies row 3 after the row addition as follows: Range("E3").Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=transtype" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "Invalid Data" .InputMessage = "" .ErrorMessage = "You must choose from the drop-down list." .ShowInput = True .ShowError = True End With It is not working and I am stymied as to what is wrong. Can you help? Thanks, Jim -- Pops Jackson "Norman Jones" wrote: Hi AD108, even code == event code --- Regards, Norman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
workbook_Open event Procedure | Excel Discussion (Misc queries) | |||
Event Procedure | Excel Programming | |||
Event Procedure again | Excel Programming | |||
Event Procedure Programming | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |