Hi all,
For some cells I can select value from Listbox, but for some cells I have to enter values manuelly.
If value from Listbox is choosen Inputbox pops up. One can either enter value or "Cancel" the action.After clicking "Cancel" chosen value from Listbox gets cleared. Now it is working.
After entering value manuelly into Cell(eg. D48) Inputbox pops up. Here is also "OK" and "Cancel" buttons. If I "Cancel" the action manuelly entered value does not get cleared, but it clears the Cell in the next line D49.
Here is code:
Thanks,
Beck
For some cells I can select value from Listbox, but for some cells I have to enter values manuelly.
If value from Listbox is choosen Inputbox pops up. One can either enter value or "Cancel" the action.After clicking "Cancel" chosen value from Listbox gets cleared. Now it is working.
After entering value manuelly into Cell(eg. D48) Inputbox pops up. Here is also "OK" and "Cancel" buttons. If I "Cancel" the action manuelly entered value does not get cleared, but it clears the Cell in the next line D49.
Here is code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
Dim strProjectNr As String
Dim strProject As String
If Intersect(Target, Range("D33:D79,D86:D97")) Is Nothing Then Exit Sub
If Target = "" Then Exit Sub
Projektnummer:
strProjectNr = InputBox("Project Nr.", "Bitte Project-Nr. eingeben:")
If strProjectNr = "" Then
ActiveCell.Clear
Exit Sub
End If
Target.Offset(0, 1) = strProjectNr
Projektname:
If Intersect(Target, Range("D33:D79")) Is Nothing Then Exit Sub
strProject = InputBox("Project Name", "Bitte Project-Name eingeben:")
Target.Offset(0, 2) = strProject
End Sub
Thanks,
Beck