Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi (again!),
I have a 3 columns for actions on a register. Planned end date (V), actual end date (W) and why was the date pushed out? (X). If the planned and actualy end date are the same this is fine and the spreadsheet flags it that the action has been closed. If they actual date is after the planned date its states it has been pushed out. How do I get it to bring up and input box when the actual date is entered in W and the dates are different? The information entered in the input box will be stored in column X. Thanks for your help |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need a worksheet change function use the one below
to Install 1) copy code below from the word SUB to the last line END SUB. 2) Go to worksheet tabe on bottom of page the initially said Sheet1 3) Right click and select View Code 4) Paste code into VBA window. 5) remove the if necessary that this website sometime inserts. Go to workbook and try it, your'll like it. Sub worksheet_change(ByVal Target As Range) If Target.Column = 23 Then If Target < Cells(Target.Row, 22) Then ReasonWhy = InputBox("Enter Reason date was Pushed back") Cells(Target.Row, 24) = ReasonWhy End If End If End Sub "Pasty" wrote: Hi (again!), I have a 3 columns for actions on a register. Planned end date (V), actual end date (W) and why was the date pushed out? (X). If the planned and actualy end date are the same this is fine and the spreadsheet flags it that the action has been closed. If they actual date is after the planned date its states it has been pushed out. How do I get it to bring up and input box when the actual date is entered in W and the dates are different? The information entered in the input box will be stored in column X. Thanks for your help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's brilliant thank you - only one thing - if I click on the cell and the
date is blank it reads it as a different date and asks for narrative is there anything I can enter to make it exit the sub if the cell is empty? "Joel" wrote: You need a worksheet change function use the one below to Install 1) copy code below from the word SUB to the last line END SUB. 2) Go to worksheet tabe on bottom of page the initially said Sheet1 3) Right click and select View Code 4) Paste code into VBA window. 5) remove the if necessary that this website sometime inserts. Go to workbook and try it, your'll like it. Sub worksheet_change(ByVal Target As Range) If Target.Column = 23 Then If Target < Cells(Target.Row, 22) Then ReasonWhy = InputBox("Enter Reason date was Pushed back") Cells(Target.Row, 24) = ReasonWhy End If End If End Sub "Pasty" wrote: Hi (again!), I have a 3 columns for actions on a register. Planned end date (V), actual end date (W) and why was the date pushed out? (X). If the planned and actualy end date are the same this is fine and the spreadsheet flags it that the action has been closed. If they actual date is after the planned date its states it has been pushed out. How do I get it to bring up and input box when the actual date is entered in W and the dates are different? The information entered in the input box will be stored in column X. Thanks for your help |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Patsy,
If Joel will excuse me playing with his code then substituting this line should fix your problem. If Target "" And Target < Cells(Target.Row, 22) Then Mike "Pasty" wrote: That's brilliant thank you - only one thing - if I click on the cell and the date is blank it reads it as a different date and asks for narrative is there anything I can enter to make it exit the sub if the cell is empty? "Joel" wrote: You need a worksheet change function use the one below to Install 1) copy code below from the word SUB to the last line END SUB. 2) Go to worksheet tabe on bottom of page the initially said Sheet1 3) Right click and select View Code 4) Paste code into VBA window. 5) remove the if necessary that this website sometime inserts. Go to workbook and try it, your'll like it. Sub worksheet_change(ByVal Target As Range) If Target.Column = 23 Then If Target < Cells(Target.Row, 22) Then ReasonWhy = InputBox("Enter Reason date was Pushed back") Cells(Target.Row, 24) = ReasonWhy End If End If End Sub "Pasty" wrote: Hi (again!), I have a 3 columns for actions on a register. Planned end date (V), actual end date (W) and why was the date pushed out? (X). If the planned and actualy end date are the same this is fine and the spreadsheet flags it that the action has been closed. If they actual date is after the planned date its states it has been pushed out. How do I get it to bring up and input box when the actual date is entered in W and the dates are different? The information entered in the input box will be stored in column X. Thanks for your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking computer dates (time) to spreadsheet dates that have formu | Excel Worksheet Functions | |||
Stop dates from showing as numbers - when formated as dates | Excel Discussion (Misc queries) | |||
how do I sort a column of random dates into Consecutive dates | Excel Worksheet Functions | |||
Toggle a range of Julian dates to Gregorian Dates and Back | Excel Programming | |||
Identifying unique dates within a range of cells containing dates | Excel Discussion (Misc queries) |