I have (with help) managed to get the following code working based on whether my target value is a * or not. This works a treat.
I now find myself in a situation where i dont have enough control of the routine to additionally decide when the code should run
my comment in the vba code attached explain more easily what i am trying to do
I would also like to replace the input boxes with a form
May I PLEASE ask if anyone submits code (which i hope you will) that they remark it otherwise i am never going to learn
Thank you in advance
I now find myself in a situation where i dont have enough control of the routine to additionally decide when the code should run
my comment in the vba code attached explain more easily what i am trying to do
I would also like to replace the input boxes with a form
May I PLEASE ask if anyone submits code (which i hope you will) that they remark it otherwise i am never going to learn
Thank you in advance
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit
Application.EnableEvents = False
With Target
' I need a further condition then ensures the trigger column is one that needs this done
' the column at row 8 will be marked with another * but hidden with a white font on white
' then to complicate it further the row number must be greater than or equal to 9 and odd
' Finally cell(L3) should indicate a valid row and column with for example the word valid
'
If .Value = "*" Then
'
' This Should run if the user is to choose * from the drop down list
'
Dim Start_time As String ' Set Shift Start Time
Dim Finish_time As String ' Set Shift Finish Time
Start_time = Inputbox("Start Time", "MANUAL ENTRY MODE 1 of 2") ' Input The Start Time
.Offset(0, 1).Value = Start_time ' Update cell with the entered start value
Finish_time = Inputbox("Finish Time", "MANUAL ENTRY MODE 2 of 2") ' Input The Finish Time
.Offset(0, 2).Value = Finish_time ' Update the cell with the entered Finish time
Else
.Offset(0, 1).Formula = "=VLOOKUP(" & .Address & ",$BE$9:$BH$20,3,FALSE)"
.Offset(0, 2).Formula = "=VLOOKUP(" & .Address & ",$BE$9:$BH$20,4,FALSE)"
End If
End With
ws_exit:
Application.EnableEvents = True
End