Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi
I am trying to get spreadsheet to input todays date into a cell if an other cell has a Y char in there. Thanks to many of you and to Frank I found I can use UDF and I took code from this site and modified it. The problem is this. I need it to trigger if the user puts in "Y" or "y" and to ignore anything else inc blancks and "n" or "N". This is the code that I am using: Private Sub Worksheet_Change(ByVal Target As Range) Dim myCell As Range If Intersect(Target, Range("J9:J109")) = "Y" Then Application.EnableEvents = False For Each myCell In Intersect(Target, Range("J9:J109")) myCell.Offset(0, 4).Value = (Date) Next myCell Application.EnableEvents = True End If If Not Intersect(Target, Range("J9:J109")) < "y" Then Application.EnableEvents = False For Each myCell In Intersect(Target, Range("J9:J109")) myCell.Offset(0, 4).Value = (Date) Next myCell Application.EnableEvents = True End If End Sub I am sure there is better way in doing the IF statment to check for both cap and lower Y's. Help! Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can cell format come from and change with reference cell format | Excel Discussion (Misc queries) | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
I Need a formula to evaluate a cell with + or - values | Excel Worksheet Functions | |||
Cell Change Color - Need Help | New Users to Excel | |||
GET.CELL | Excel Worksheet Functions |