Thema Datum  Von Nutzer Rating
Antwort
06.06.2014 12:47:52 Corina
NotSolved
06.06.2014 14:32:26 Amicro2000
NotSolved
06.06.2014 14:56:37 Gast15358
NotSolved
06.06.2014 15:17:35 Amicro2000
NotSolved
10.06.2014 09:00:57 Corina
NotSolved
10.06.2014 09:00:58 Corina
NotSolved
Rot Damit der Faden nicht abreißt, .......
11.06.2014 21:55:31 Hmm..Hmm..
*****
Solved
12.06.2014 09:09:38 Corina
NotSolved
12.06.2014 09:09:38 Corina
NotSolved
12.06.2014 09:09:38 Corina
NotSolved
12.06.2014 21:54:18 Hmm..Hmm..
*****
NotSolved
13.06.2014 09:49:18 Corina
NotSolved

Ansicht des Beitrags:
Von:
Hmm..Hmm..
Datum:
11.06.2014 21:55:31
Views:
1405
Rating: Antwort:
 Nein
Thema:
Damit der Faden nicht abreißt, .......
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
'Shows dropdown entries for reference columns
Dim blnSub As Boolean
Dim clOffset As Long
Dim strFormula1 As String

  If Target.Count > 1 Then Exit Sub
  If Target.row < 6 Then Exit Sub
  
  Select Case Target.column
  
    Case 3
      strFormula1 = "=Drivers"
    Case 5
      strFormula1 = "=Category"
    Case 6
    'consider guidelines of user interface in functional areas:
    'like data entry, data display, sequence control,  data transmission, and data protection
      If Len(Target.Formula) > 0 Then
        strFormula1 = "=" & Target.Formula
        blnSub = True
      End If
    Case 10
      strFormula1 = "=Organizational_level"
    Case Else
      Exit Sub
  End Select
  
  clOffset = 1
  If ChkValidation(blnSub, clOffset, Len(Target.Formula), Target.Offset(0, clOffset), _
    3, 1, 1, strFormula1) Then Target.Offset(0, clOffset).Select
  
End Sub

Private Function ChkValidation(IsSub As Boolean, IsOffset As Long, _
  tLen As Long, vCell As Range, _
  vlType As XlDVType, vlStyle As XlDVAlertStyle, vlOperator As XlFormatConditionOperator, _
  vlFormula1 As Variant, Optional vlFormula2 As Variant) As Boolean

'On Error GoTo errh
  If Len(vCell.Validation.Parent) > 0 Then
    If tLen = 0 Then
      Application.EnableEvents = False
      vCell.Validation.Delete
      vCell.Formula = vbNullString
      If IsSub Then
        vCell.Offset(0, IsOffset).Validation.Delete
        vCell.Offset(0, IsOffset).Formula = vbNullString
      End If
    End If
  Else
    If tLen > 0 Then
      vCell.Validation.Delete
      vCell.Validation.Add Type:=vlType, AlertStyle:=vlStyle, _
        Operator:=vlOperator, Formula1:=vlFormula1, Formula2:=vlFormula2
      With vCell.Validation
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .Errormessage = ""
        .ShowInput = False
        .ShowError = True
      End With
    End If
  End If

errh:
If Err.number = 0 Then ChkValidation = True
Application.EnableEvents = True
End Function

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
06.06.2014 12:47:52 Corina
NotSolved
06.06.2014 14:32:26 Amicro2000
NotSolved
06.06.2014 14:56:37 Gast15358
NotSolved
06.06.2014 15:17:35 Amicro2000
NotSolved
10.06.2014 09:00:57 Corina
NotSolved
10.06.2014 09:00:58 Corina
NotSolved
Rot Damit der Faden nicht abreißt, .......
11.06.2014 21:55:31 Hmm..Hmm..
*****
Solved
12.06.2014 09:09:38 Corina
NotSolved
12.06.2014 09:09:38 Corina
NotSolved
12.06.2014 09:09:38 Corina
NotSolved
12.06.2014 21:54:18 Hmm..Hmm..
*****
NotSolved
13.06.2014 09:49:18 Corina
NotSolved