Morning all
I have been working on some code to force users of one of my workbooks to fill in information via a user form when they enter data in a cell.
The sheet in question is around 250 lines long with data entered into cells
g4 to g12(g13 is the total)
g14 to g22 and so on to cell 250
What im looking to do is trigger a userform to enter data in cell l4 when something is entered in g4.
And the same to happen with G5 and L5 and so on.
This is the code i have put together but i am unsure how to make in line specific without having hundreds of seperate peices of code.
Finally i would appreciate a little point in the right direction as to how i can write some code to delete the data entered into G* if the userform is closed without entering the shift.
Phew
Any advice would be appreciated
Earl
I have attached what i have done so far below
Sub Shiftdam1()
Shiftdam = InputBox(Prompt:="Enter Shift", _
Title:="Process Downtime Tracking", Default:="")
Range("l4").Value = Shiftdam
If Shiftdam = vbNullString Then Exit Sub
If IsNumeric(Shiftdam) Then
MsgBox "Sorry, text only"
TextBox1 = vbNullString
Cancel = True
End If
If CloseMode = 0 Then Cancel = True
End Sub
I have been working on some code to force users of one of my workbooks to fill in information via a user form when they enter data in a cell.
The sheet in question is around 250 lines long with data entered into cells
g4 to g12(g13 is the total)
g14 to g22 and so on to cell 250
What im looking to do is trigger a userform to enter data in cell l4 when something is entered in g4.
And the same to happen with G5 and L5 and so on.
This is the code i have put together but i am unsure how to make in line specific without having hundreds of seperate peices of code.
Finally i would appreciate a little point in the right direction as to how i can write some code to delete the data entered into G* if the userform is closed without entering the shift.
Phew
Any advice would be appreciated
Earl
I have attached what i have done so far below
Sub Shiftdam1()
Shiftdam = InputBox(Prompt:="Enter Shift", _
Title:="Process Downtime Tracking", Default:="")
Range("l4").Value = Shiftdam
If Shiftdam = vbNullString Then Exit Sub
If IsNumeric(Shiftdam) Then
MsgBox "Sorry, text only"
TextBox1 = vbNullString
Cancel = True
End If
If CloseMode = 0 Then Cancel = True
End Sub